/* ============================================================
   تحدي الكلمات — app.css  (يعتمد توكنز واثق من tokens.css)
   RTL · Mobile First · هوية واثق (بنفسجي + تدرّج البرتقالي/الأزرق)
   ============================================================ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font-ar); background: var(--bg); color: var(--fg); line-height: var(--leading-normal); overscroll-behavior-y: none; }
#root { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-ar); cursor: pointer; border: 0; background: none; }
img { max-width: 100%; display: block; }
input, select, textarea { font-family: var(--font-ar); }
::selection { background: var(--violet-200); }
.en { direction: ltr; unicode-bidi: isolate; font-family: var(--font-latin); }
.num { font-family: var(--font-latin); font-feature-settings: "tnum" 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- أزرار ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 15px; border-radius: var(--radius-pill); padding: 13px 26px; transition: all var(--dur-base) var(--ease-out); white-space: nowrap; min-height: 48px; }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-violet); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: var(--shadow-orange); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-grad { background: var(--grad-ribbon); background-size: 150% 150%; color: #fff; box-shadow: var(--shadow-violet); }
.btn-grad:hover { background-position: 100% 0; box-shadow: var(--shadow-lg); }
.btn-secondary { background: var(--surface); color: var(--violet-700); border: 1.5px solid var(--border-strong); }
.btn-secondary:hover { border-color: var(--violet-400); }
.btn-ghost { background: transparent; color: var(--violet-700); box-shadow: none; }
.btn-ghost:hover { color: var(--orange-600); background: var(--violet-50); }
.btn-danger { background: var(--error); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { font-size: 16px; padding: 16px 30px; min-height: 56px; }
.btn-sm { font-size: 13px; padding: 8px 16px; min-height: 38px; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ---------- بطاقات وحقول ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 700; color: var(--fg-heading); margin-bottom: 7px; }
.input, .select { width: 100%; padding: 13px 15px; font-size: 15px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); color: var(--fg); transition: border-color var(--dur-fast), box-shadow var(--dur-fast); min-height: 48px; }
.input:focus, .select:focus { outline: none; border-color: var(--violet-400); box-shadow: var(--ring-shadow); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 700; }
.chip-soft { background: var(--violet-50); color: var(--violet-700); }
.chip-orange { background: var(--orange-50); color: var(--orange-700); }
.chip-green { background: var(--green-50); color: var(--green-500); }
.chip-gray { background: var(--surface-2); color: var(--fg-muted); }

/* ---------- شريط تقدّم ---------- */
.bar { height: 10px; background: var(--neutral-200); border-radius: var(--radius-pill); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--grad-ribbon); border-radius: var(--radius-pill); transition: width var(--dur-slow) var(--ease-out); }
.bar.thin { height: 7px; }

/* ============================================================
   LANDING
   ============================================================ */
.landing { min-height: 100vh; background: radial-gradient(900px 500px at 85% -8%, rgba(255,138,0,.12), transparent 60%), radial-gradient(900px 600px at -5% 110%, rgba(53,101,174,.14), transparent 60%), var(--bg); }
.land-nav { display: flex; align-items: center; justify-content: space-between; max-width: 1140px; margin: 0 auto; padding: 18px 22px; }
.land-brand { display: flex; align-items: center; gap: 10px; }
.land-brand img { height: 40px; width: auto; }
.land-brand b { font-family: var(--font-display); font-weight: 900; font-size: 21px; color: var(--violet-700); }
.land-hero { max-width: 1140px; margin: 0 auto; padding: 30px 22px 60px; display: grid; grid-template-columns: 1fr; gap: 38px; align-items: center; }
.land-eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs); border-radius: var(--radius-pill); padding: 7px 15px; font-size: 13px; font-weight: 700; color: var(--violet-700); }
.land-eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange-500); }
.land-hero h1 { font-family: var(--font-display); font-weight: 900; font-size: clamp(34px, 8vw, 56px); line-height: 1.12; letter-spacing: -.02em; color: var(--fg-heading); margin: 18px 0 0; }
.land-hero h1 .g { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.land-hero .lead { font-size: clamp(16px, 4.4vw, 20px); color: var(--fg-muted); margin: 18px 0 0; max-width: 540px; }
.land-cta { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.land-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 34px; max-width: 540px; }
.land-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-xs); }
.land-stat .v { font-family: var(--font-latin); font-weight: 800; font-size: 26px; color: var(--violet-700); line-height: 1; }
.land-stat .l { font-size: 12.5px; color: var(--fg-muted); margin-top: 5px; }
.land-visual { position: relative; }
.land-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 26px; }
.land-feats { max-width: 1140px; margin: 0 auto; padding: 20px 22px 70px; display: grid; grid-template-columns: 1fr; gap: 16px; }
.land-feat { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); transition: all var(--dur-base) var(--ease-out); }
.land-feat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--violet-200); }
.land-feat .ic { flex: none; width: 48px; height: 48px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: #fff; }
.land-feat .ic svg { width: 24px; height: 24px; }
.land-feat h3 { font-family: var(--font-display); font-weight: 800; font-size: 18px; margin: 0 0 5px; color: var(--fg-heading); }
.land-feat p { margin: 0; font-size: 14.5px; color: var(--fg-muted); }
@media (min-width: 860px) {
  .land-hero { grid-template-columns: 1.05fr .95fr; padding-top: 50px; }
  .land-feats { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   AUTH (login)
   ============================================================ */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(700px 420px at 50% -10%, rgba(123,63,158,.16), transparent 60%), var(--bg); }
.auth-box { width: 100%; max-width: 410px; }
.auth-box .brand { text-align: center; margin-bottom: 24px; }
.auth-box .brand img { height: 56px; margin: 0 auto 12px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 30px 26px; }
.auth-card h2 { font-family: var(--font-display); font-weight: 800; font-size: 23px; color: var(--fg-heading); margin: 0 0 4px; }
.auth-card .sub { font-size: 14px; color: var(--fg-muted); margin: 0 0 22px; }
.pw-wrap { position: relative; }
.pw-wrap .toggle { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; color: var(--fg-muted); border-radius: var(--radius-sm); }
.pw-wrap .toggle:hover { background: var(--surface-2); }
.pw-wrap .input { padding-inline-end: 46px; }
.auth-err { background: var(--error-soft); color: var(--error); border-radius: var(--radius-md); padding: 11px 14px; font-size: 13.5px; font-weight: 600; margin-bottom: 14px; display: flex; gap: 8px; align-items: center; }
.auth-hint { margin-top: 18px; font-size: 12.5px; color: var(--fg-subtle); text-align: center; line-height: 1.7; }
.auth-hint code { background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-family: var(--font-latin); color: var(--violet-700); }

/* ============================================================
   APP SHELL (participant)
   ============================================================ */
.app { min-height: 100vh; padding-bottom: 86px; }
.appbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.appbar-in { max-width: 760px; margin: 0 auto; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.appbar .brand { display: flex; align-items: center; gap: 9px; }
.appbar .brand img { height: 32px; }
.appbar .brand b { font-family: var(--font-display); font-weight: 900; font-size: 17px; color: var(--violet-700); }
.appbar .pts { display: inline-flex; align-items: center; gap: 6px; background: var(--orange-50); color: var(--orange-700); font-weight: 800; font-size: 14px; padding: 7px 13px; border-radius: var(--radius-pill); }
.appbar .pts svg { width: 16px; height: 16px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 20px 18px; }
.page-title { font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--fg-heading); margin: 0 0 4px; }
.page-sub { font-size: 14px; color: var(--fg-muted); margin: 0 0 20px; }

/* bottom nav */
.botnav { position: fixed; bottom: 0; inset-inline: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--border); display: flex; padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
.botnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--fg-subtle); font-size: 11px; font-weight: 700; border-radius: var(--radius-md); transition: color var(--dur-fast); }
.botnav a svg { width: 23px; height: 23px; }
.botnav a.active { color: var(--violet-700); }
.botnav a.active .ico-bubble { background: var(--violet-50); }
.botnav .ico-bubble { display: flex; align-items: center; justify-content: center; width: 46px; height: 30px; border-radius: var(--radius-pill); transition: background var(--dur-fast); }

/* ---------- dashboard ---------- */
.hero-card { background: var(--grad-violet); color: #fff; border-radius: var(--radius-xl); padding: 24px; position: relative; overflow: hidden; box-shadow: var(--shadow-violet); }
.hero-card::after { content: ""; position: absolute; top: -70px; inset-inline-start: -30px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255,138,0,.32), transparent 62%); }
.hero-card > * { position: relative; }
.hero-card .hi { font-size: 14px; opacity: .85; }
.hero-card .nm { font-family: var(--font-display); font-weight: 900; font-size: 26px; margin: 2px 0 0; }
.hero-card .grp { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; background: rgba(255,255,255,.16); padding: 5px 12px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 700; }
.hero-card .grp .gc { width: 11px; height: 11px; border-radius: 50%; }
.hero-prog { margin-top: 18px; }
.hero-prog .row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 7px; opacity: .92; }
.hero-prog .bar { background: rgba(255,255,255,.22); }
.hero-prog .bar > i { background: var(--grad-warm); }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-xs); display: flex; align-items: center; gap: 12px; }
.stat-card .ic { width: 42px; height: 42px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.stat-card .ic svg { width: 21px; height: 21px; }
.stat-card .v { font-family: var(--font-latin); font-weight: 800; font-size: 22px; color: var(--fg-heading); line-height: 1; }
.stat-card .l { font-size: 12.5px; color: var(--fg-muted); margin-top: 3px; }
.bg-violet { background: var(--grad-violet); } .bg-warm { background: var(--grad-warm); } .bg-cool { background: var(--grad-cool); } .bg-green { background: linear-gradient(135deg,#34c98a,#16A06A); }

.sect-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 14px; }
.sect-head h2 { font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--fg-heading); margin: 0; }
.sect-head a { font-size: 13px; font-weight: 700; color: var(--orange-600); }

.continue-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); }
.continue-card .num-badge { width: 52px; height: 52px; border-radius: var(--radius-md); background: var(--grad-ribbon); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-latin); font-weight: 800; font-size: 19px; flex: none; }
.continue-card .t { flex: 1; min-width: 0; }
.continue-card .t b { display: block; font-size: 15px; color: var(--fg-heading); }
.continue-card .t span { font-size: 13px; color: var(--fg-muted); }

/* ---------- level map ---------- */
.map { position: relative; padding: 8px 0 30px; }
.map-track { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; }
.lvl-row { display: flex; justify-content: center; width: 100%; position: relative; padding: 11px 0; }
.lvl-row:nth-child(odd) { transform: translateX(-58px); }
.lvl-row:nth-child(even) { transform: translateX(58px); }
.lvl-node { position: relative; width: 78px; height: 78px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--font-latin); font-weight: 800; transition: transform var(--dur-base) var(--ease-spring); border: 0; }
.lvl-node:active { transform: scale(.93); }
.lvl-node .ln { font-size: 21px; line-height: 1; }
.lvl-node .lc { font-size: 10px; font-family: var(--font-ar); font-weight: 700; opacity: .9; margin-top: 1px; }
.lvl-node.completed { background: var(--grad-violet); color: #fff; box-shadow: var(--shadow-violet); }
.lvl-node.available { background: var(--grad-warm); color: #fff; box-shadow: var(--shadow-orange); }
.lvl-node.locked { background: var(--surface-2); color: var(--fg-subtle); border: 2px dashed var(--border-strong); box-shadow: none; }
.lvl-node.available::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 3px solid var(--orange-300); opacity: .6; animation: pulse 2s var(--ease-out) infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .6; } 70% { transform: scale(1.22); opacity: 0; } 100% { opacity: 0; } }
.lvl-stars { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); display: flex; gap: 1px; background: var(--surface); border-radius: var(--radius-pill); padding: 2px 5px; box-shadow: var(--shadow-xs); }
.lvl-stars svg { width: 11px; height: 11px; }
.lvl-lock { position: absolute; bottom: -6px; right: -2px; background: var(--surface); border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-xs); }
.lvl-lock svg { width: 12px; height: 12px; color: var(--fg-subtle); }
.lvl-title { position: absolute; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 12.5px; font-weight: 700; color: var(--fg-muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.lvl-row:nth-child(odd) .lvl-title { inset-inline-start: calc(50% + 52px); }
.lvl-row:nth-child(even) .lvl-title { inset-inline-end: calc(50% + 52px); text-align: end; }
.map-checkpoint { margin: 4px auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 7px 18px; font-size: 12.5px; font-weight: 800; color: var(--violet-700); box-shadow: var(--shadow-xs); display: inline-flex; align-items: center; gap: 7px; }
.map-checkpoint svg { width: 15px; height: 15px; color: var(--orange-500); }

/* levels as grid alt view */
.lvl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.lvl-cardx { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-xs); text-align: center; }

/* ---------- word learning ---------- */
.learn { max-width: 560px; margin: 0 auto; }
.learn-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.learn-top .bar { flex: 1; }
.learn-top .x { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--fg-muted); }
.wcount { font-family: var(--font-latin); font-weight: 800; font-size: 13px; color: var(--fg-muted); }
.word-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 30px 24px; text-align: center; position: relative; overflow: hidden; }
.word-card .cat { position: absolute; top: 14px; inset-inline-end: 16px; font-size: 11px; font-weight: 700; color: var(--violet-400); }
.word-en { font-family: var(--font-latin); font-weight: 800; font-size: clamp(34px, 11vw, 52px); color: var(--fg-heading); line-height: 1.05; margin-top: 10px; direction: ltr; }
.word-speak { margin: 14px auto 0; width: 60px; height: 60px; border-radius: 50%; background: var(--grad-warm); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-orange); transition: transform var(--dur-fast); }
.word-speak:active { transform: scale(.9); }
.word-speak svg { width: 28px; height: 28px; }
.word-speak.playing { animation: ring 1s var(--ease-out) infinite; }
@keyframes ring { 0%,100% { box-shadow: var(--shadow-orange); } 50% { box-shadow: 0 0 0 10px rgba(255,122,0,.18); } }
.word-ar { font-size: 26px; font-weight: 800; color: var(--violet-700); margin-top: 16px; }
.word-ex { background: var(--surface-tint); border-radius: var(--radius-lg); padding: 16px; margin-top: 20px; text-align: start; }
.word-ex .en { font-family: var(--font-latin); font-size: 16px; color: var(--fg); font-weight: 500; }
.word-ex .ar { font-size: 15px; color: var(--fg-muted); margin-top: 7px; }
.word-ex .lbl { font-size: 11px; font-weight: 800; letter-spacing: .04em; color: var(--violet-400); margin-bottom: 8px; text-transform: uppercase; }
.review-toggle { display: flex; gap: 10px; margin-top: 18px; }
.review-toggle button { flex: 1; padding: 11px; border-radius: var(--radius-md); font-weight: 700; font-size: 13.5px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--fg-muted); display: flex; align-items: center; justify-content: center; gap: 7px; }
.review-toggle button svg { width: 16px; height: 16px; }
.review-toggle button.on-good { border-color: var(--green-500); background: var(--green-50); color: var(--green-500); }
.review-toggle button.on-need { border-color: var(--amber-500); background: var(--amber-50); color: var(--amber-500); }
.learn-nav { display: flex; gap: 12px; margin-top: 18px; }
.learn-nav .btn { flex: 1; }

/* ---------- quiz ---------- */
.quiz { max-width: 560px; margin: 0 auto; }
.quiz-q { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: 24px; }
.quiz-type { font-size: 12px; font-weight: 800; color: var(--orange-600); letter-spacing: .02em; }
.quiz-prompt { font-size: 20px; font-weight: 800; color: var(--fg-heading); margin: 10px 0 4px; line-height: 1.4; }
.quiz-word { font-family: var(--font-latin); font-weight: 800; font-size: 34px; color: var(--violet-700); direction: ltr; text-align: center; margin: 8px 0; }
.opts { display: grid; gap: 11px; margin-top: 18px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: var(--radius-md); border: 1.8px solid var(--border-strong); background: var(--surface); font-size: 17px; font-weight: 700; color: var(--fg); text-align: start; transition: all var(--dur-fast); min-height: 56px; }
.opt:hover { border-color: var(--violet-400); }
.opt .k { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); color: var(--fg-muted); display: flex; align-items: center; justify-content: center; font-family: var(--font-latin); font-weight: 800; font-size: 14px; flex: none; }
.opt.correct { border-color: var(--green-500); background: var(--green-50); color: var(--green-500); }
.opt.correct .k { background: var(--green-500); color: #fff; }
.opt.wrong { border-color: var(--error); background: var(--error-soft); color: var(--error); }
.opt.wrong .k { background: var(--error); color: #fff; }
.opt.muted { opacity: .5; }
.opt .en { font-family: var(--font-latin); }
.fill-input { font-family: var(--font-latin); direction: ltr; text-align: center; font-size: 26px; font-weight: 800; letter-spacing: .12em; }
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.match-col { display: grid; gap: 9px; }
.match-item { padding: 14px; border-radius: var(--radius-md); border: 1.8px solid var(--border-strong); background: var(--surface); font-weight: 700; font-size: 16px; text-align: center; transition: all var(--dur-fast); }
.match-item.sel { border-color: var(--violet-500); background: var(--violet-50); }
.match-item.done { border-color: var(--green-500); background: var(--green-50); color: var(--green-500); opacity: .8; pointer-events: none; }
.match-item.err { border-color: var(--error); background: var(--error-soft); animation: shake .3s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.feedback { margin-top: 16px; border-radius: var(--radius-lg); padding: 16px; display: flex; align-items: center; gap: 12px; animation: rise var(--dur-base) var(--ease-out); }
.feedback.ok { background: var(--green-50); color: var(--green-500); }
.feedback.no { background: var(--error-soft); color: var(--error); }
.feedback .fi { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.feedback.ok .fi { background: var(--green-500); color: #fff; } .feedback.no .fi { background: var(--error); color: #fff; }
.feedback b { display: block; font-size: 15px; } .feedback span { font-size: 13px; opacity: .9; }
.feedback .en { font-family: var(--font-latin); font-weight: 800; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- results ---------- */
.result { max-width: 480px; margin: 0 auto; text-align: center; padding-top: 16px; }
.result-medal { width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-violet); }
.result-medal.win { background: var(--grad-ribbon); } .result-medal.lose { background: var(--grad-violet); }
.result-medal svg { width: 54px; height: 54px; color: #fff; }
.result h1 { font-family: var(--font-display); font-weight: 900; font-size: 28px; color: var(--fg-heading); margin: 0; }
.result .stars { display: flex; gap: 6px; justify-content: center; margin: 14px 0; }
.result .stars svg { width: 34px; height: 34px; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0; }
.result-grid .b { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 8px; }
.result-grid .b .v { font-family: var(--font-latin); font-weight: 800; font-size: 22px; color: var(--fg-heading); }
.result-grid .b .l { font-size: 12px; color: var(--fg-muted); margin-top: 3px; }
.points-pop { background: var(--orange-50); color: var(--orange-700); border-radius: var(--radius-lg); padding: 14px; font-weight: 800; font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.new-badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 16px 0; }

/* ---------- badges / achievements ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.badge { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 14px; text-align: center; box-shadow: var(--shadow-xs); transition: all var(--dur-base) var(--ease-out); }
.badge.earned { border-color: var(--orange-200); }
.badge.locked { opacity: .55; }
.badge .bi { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; }
.badge.earned .bi { background: var(--grad-ribbon); color: #fff; box-shadow: var(--shadow-orange); }
.badge.locked .bi { background: var(--surface-2); color: var(--fg-subtle); }
.badge .bi svg { width: 28px; height: 28px; }
.badge b { font-size: 14px; color: var(--fg-heading); display: block; }
.badge span { font-size: 12px; color: var(--fg-muted); display: block; margin-top: 3px; }
@media (min-width: 560px) { .badge-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- leaderboard ---------- */
.lb-podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 10px 0 22px; }
.podium { text-align: center; flex: 1; max-width: 110px; }
.podium .av { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 20px; box-shadow: var(--shadow-md); }
.podium .nm { font-size: 12.5px; font-weight: 700; color: var(--fg-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium .pt { font-family: var(--font-latin); font-weight: 800; font-size: 14px; color: var(--orange-600); }
.podium .stand { border-radius: var(--radius-md) var(--radius-md) 0 0; margin-top: 8px; display: flex; align-items: flex-start; justify-content: center; padding-top: 8px; font-family: var(--font-latin); font-weight: 900; color: #fff; font-size: 18px; }
.podium.r1 .av { width: 66px; height: 66px; } .podium.r1 .stand { height: 74px; background: var(--grad-warm); }
.podium.r2 .stand { height: 56px; background: var(--violet-400); }
.podium.r3 .stand { height: 42px; background: var(--blue-400); }
.lb-list { display: flex; flex-direction: column; gap: 9px; }
.lb-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; box-shadow: var(--shadow-xs); }
.lb-row.me { border-color: var(--violet-400); background: var(--violet-50); box-shadow: var(--shadow-sm); }
.lb-row .rk { width: 30px; font-family: var(--font-latin); font-weight: 800; font-size: 16px; color: var(--fg-muted); text-align: center; flex: none; }
.lb-row .av { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 15px; flex: none; }
.lb-row .nm { flex: 1; min-width: 0; }
.lb-row .nm b { font-size: 14.5px; color: var(--fg-heading); display: block; }
.lb-row .nm span { font-size: 12px; color: var(--fg-muted); }
.lb-row .pt { font-family: var(--font-latin); font-weight: 800; font-size: 15px; color: var(--violet-700); }

/* ---------- profile ---------- */
.prof-head { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 0 4px; }
.prof-av { width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; color: #fff; font-size: 34px; box-shadow: var(--shadow-violet); }
.prof-list { margin-top: 18px; }
.prof-item { display: flex; align-items: center; justify-content: space-between; padding: 15px 4px; border-bottom: 1px solid var(--border); }
.prof-item:last-child { border-bottom: 0; }
.prof-item .l { font-size: 14px; color: var(--fg-muted); }
.prof-item .v { font-size: 14.5px; font-weight: 700; color: var(--fg-heading); }

/* ============================================================
   ADMIN
   ============================================================ */
.admin { min-height: 100vh; display: flex; }
.admin-side { width: 250px; flex: none; background: var(--violet-900); color: #fff; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .brand { display: flex; align-items: center; gap: 9px; padding: 6px 8px 18px; }
.admin-side .brand img { height: 32px; }
.admin-side .brand b { font-family: var(--font-display); font-weight: 900; font-size: 16px; }
.admin-nav { display: flex; flex-direction: column; gap: 3px; }
.admin-nav a { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; color: rgba(255,255,255,.72); transition: all var(--dur-fast); }
.admin-nav a svg { width: 19px; height: 19px; }
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a.active { background: var(--grad-ribbon); color: #fff; box-shadow: var(--shadow-orange); }
.admin-side .sidefoot { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 14px 26px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.admin-top h1 { font-family: var(--font-display); font-weight: 800; font-size: 21px; color: var(--fg-heading); margin: 0; }
.admin-top .burger { display: none; width: 42px; height: 42px; border-radius: var(--radius-md); background: var(--surface-2); align-items: center; justify-content: center; }
.admin-body { padding: 26px; max-width: 1180px; width: 100%; }
.admin-overlay { display: none; }
@media (max-width: 900px) {
  .admin-side { position: fixed; z-index: 60; inset-inline-start: 0; top: 0; transform: translateX(100%); transition: transform var(--dur-base) var(--ease-out); }
  .admin-side.open { transform: none; box-shadow: var(--shadow-lg); }
  .admin-top .burger { display: flex; }
  .admin-overlay.show { display: block; position: fixed; inset: 0; background: rgba(24,18,42,.4); z-index: 55; }
  .admin-body { padding: 18px 16px; }
}

.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 700px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-xs); }
.kpi .ic { width: 40px; height: 40px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: #fff; margin-bottom: 12px; }
.kpi .ic svg { width: 20px; height: 20px; }
.kpi .v { font-family: var(--font-latin); font-weight: 800; font-size: 28px; color: var(--fg-heading); line-height: 1; }
.kpi .l { font-size: 13px; color: var(--fg-muted); margin-top: 5px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); overflow: hidden; }
.panel-head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-head h3 { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--fg-heading); margin: 0; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { position: relative; }
.search svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--fg-subtle); }
.search .input { padding-inline-start: 38px; min-height: 42px; min-width: 220px; }

table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th { text-align: start; font-size: 12px; font-weight: 800; color: var(--fg-muted); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr:hover td { background: var(--neutral-50); }
.t-actions { display: flex; gap: 6px; }
.icon-btn { width: 34px; height: 34px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; color: var(--fg-muted); border: 1px solid var(--border); background: var(--surface); transition: all var(--dur-fast); }
.icon-btn:hover { border-color: var(--violet-400); color: var(--violet-700); }
.icon-btn.danger:hover { border-color: var(--error); color: var(--error); background: var(--error-soft); }
.dot-status { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-inline-end: 6px; }
.dot-on { background: var(--green-500); } .dot-off { background: var(--neutral-400); }

/* table → cards on mobile */
.cards-mobile { display: none; }
@media (max-width: 760px) {
  table.tbl { display: none; }
  .cards-mobile { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
  .data-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; }
  .data-card .dc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
  .data-card .dc-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
  .data-card .dc-row .l { color: var(--fg-muted); }
  .search .input { min-width: 0; width: 100%; }
  .toolbar { width: 100%; }
}

.gbar { display: flex; flex-direction: column; gap: 12px; }
.gbar-row { display: grid; grid-template-columns: 120px 1fr 60px; gap: 12px; align-items: center; }
.gbar-row .nm { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.gbar-row .nm .gc { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.gbar-row .track { height: 14px; background: var(--neutral-200); border-radius: var(--radius-pill); overflow: hidden; }
.gbar-row .track > i { display: block; height: 100%; border-radius: var(--radius-pill); }
.gbar-row .vv { font-family: var(--font-latin); font-weight: 800; font-size: 14px; text-align: end; }

/* verification */
.verify-hero { border-radius: var(--radius-lg); padding: 22px; display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.verify-hero.ok { background: var(--green-50); } .verify-hero.bad { background: var(--error-soft); }
.verify-hero .vi { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.verify-hero.ok .vi { background: var(--green-500); color: #fff; } .verify-hero.bad .vi { background: var(--error); color: #fff; }
.verify-hero .vi svg { width: 28px; height: 28px; }
.verify-hero h3 { margin: 0; font-size: 19px; color: var(--fg-heading); font-family: var(--font-display); font-weight: 800; }
.verify-hero p { margin: 4px 0 0; font-size: 14px; color: var(--fg-muted); }
.check-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 9px; background: var(--surface); }
.check-row .ci { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; color: #fff; }
.check-row .ci.ok { background: var(--green-500); } .check-row .ci.no { background: var(--error); }
.check-row .ct { flex: 1; } .check-row .ct b { font-size: 14px; color: var(--fg-heading); } .check-row .ct span { display: block; font-size: 12.5px; color: var(--fg-muted); }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(24,18,42,.5); backdrop-filter: blur(3px); z-index: 80; display: grid; place-items: center; padding: 20px; animation: fade var(--dur-base); }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; animation: pop var(--dur-base) var(--ease-spring); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal-head { padding: 20px 22px 0; display: flex; align-items: flex-start; justify-content: space-between; }
.modal-head h3 { font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--fg-heading); margin: 0; }
.modal-head .x { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--fg-muted); }
.modal-head .x:hover { background: var(--surface-2); }
.modal-body { padding: 18px 22px; }
.modal-foot { padding: 14px 22px 22px; display: flex; gap: 10px; justify-content: flex-end; }
.confirm-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--error-soft); color: var(--error); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }

/* ---------- toast ---------- */
.toasts { position: fixed; bottom: 100px; inset-inline: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--neutral-900); color: #fff; border-radius: var(--radius-pill); padding: 11px 20px; font-size: 14px; font-weight: 700; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 9px; animation: rise var(--dur-base) var(--ease-out); max-width: 90vw; }
.toast svg { width: 17px; height: 17px; }
.toast.ok { background: var(--green-500); } .toast.err { background: var(--error); } .toast.info { background: var(--violet-700); }

/* ---------- skeleton & empty ---------- */
.skel { background: linear-gradient(90deg, var(--neutral-100) 25%, var(--neutral-200) 37%, var(--neutral-100) 63%); background-size: 400% 100%; animation: sk 1.3s infinite; border-radius: var(--radius-md); }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.empty { text-align: center; padding: 50px 20px; color: var(--fg-muted); }
.empty .ei { width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; color: var(--fg-subtle); }
.empty .ei svg { width: 30px; height: 30px; }
.empty b { display: block; font-size: 16px; color: var(--fg-heading); margin-bottom: 4px; }

.divider { height: 1px; background: var(--border); margin: 18px 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex { display: flex; } .gap8 { gap: 8px; } .gap12 { gap: 12px; } .wrap-flex { flex-wrap: wrap; }
.mt8{margin-top:8px;}.mt12{margin-top:12px;}.mt16{margin-top:16px;}.mt20{margin-top:20px;}.mt24{margin-top:24px;}
.muted { color: var(--fg-muted); } .small { font-size: 13px; } .center { text-align: center; }
.chip-violet { background: var(--violet-100); color: var(--violet-700); }

/* ============================================================
   الجولات الزمنية + المؤثرات الصوتية (إضافة)
   ============================================================ */

/* --- بطاقة الجولة في لوحة المشارك --- */
.round-banner { background: linear-gradient(135deg, var(--violet-700), var(--violet-900)); color: #fff; border-radius: var(--radius-xl); padding: 18px; box-shadow: var(--shadow-violet); margin-bottom: 18px; position: relative; overflow: hidden; }
.round-banner::after { content: ""; position: absolute; inset-block-start: -40%; inset-inline-end: -10%; width: 180px; height: 180px; background: var(--grad-ribbon); opacity: .35; filter: blur(38px); border-radius: 50%; pointer-events: none; }
.round-banner.none { background: var(--surface); color: var(--fg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 14px; }
.round-banner.none::after { display: none; }
.round-banner.none .rb-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--violet-50); color: var(--violet-600); display: flex; align-items: center; justify-content: center; flex: none; }
.round-banner.none .rb-body { flex: 1; } .round-banner.none .rb-body b { display: block; color: var(--fg-heading); font-size: 15px; } .round-banner.none .rb-body span { font-size: 13px; color: var(--fg-muted); }
.rb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.rb-name { font-family: var(--font-display); font-size: 19px; }
.rb-desc { margin: 6px 0 0; font-size: 13px; opacity: .85; position: relative; z-index: 1; }
.rb-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.rb-stats > div { background: rgba(255,255,255,.12); border-radius: var(--radius-md); padding: 10px 8px; text-align: center; }
.rb-stats .v { display: block; font-size: 20px; font-weight: 800; font-family: var(--font-latin); }
.rb-stats .l { font-size: 11px; opacity: .85; }
.rb-warn { margin-top: 12px; background: rgba(255,255,255,.16); border-radius: var(--radius-md); padding: 9px 12px; font-size: 13px; display: flex; align-items: center; gap: 8px; font-weight: 700; position: relative; z-index: 1; }
.round-banner .btn-grad { position: relative; z-index: 1; }

/* --- حالة الجولة (شارة) --- */
.rstatus { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 800; }
.rstatus.rs-active { background: var(--green-500); color: #fff; }
.rstatus.rs-sched { background: rgba(255,255,255,.2); color: #fff; }
.rs-ended, .rs-arch { background: rgba(255,255,255,.2); color: #fff; }
.round-banner.none .rstatus.rs-ended { background: var(--orange-50); color: var(--orange-700); }
.round-banner.none .rstatus.rs-arch { background: var(--surface-2); color: var(--fg-muted); }
.cd { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; font-family: var(--font-ar); }
.cd .num, .cd { font-feature-settings: "tnum" 1; }
.cd.urgent { color: var(--orange-300); }
.admin-round-strip .cd, .panel .cd { color: var(--violet-700); }
.admin-round-strip .cd.urgent { color: var(--orange-600); }

/* --- جولاتي السابقة --- */
.round-hist { display: grid; gap: 12px; }
.rh-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); }
.rh-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rh-top b { font-family: var(--font-display); color: var(--fg-heading); font-size: 16px; }
.rh-top .rstatus.rs-ended { background: var(--orange-50); color: var(--orange-700); }
.rh-top .rstatus.rs-arch { background: var(--surface-2); color: var(--fg-muted); }
.rh-dates { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-muted); margin-top: 6px; font-family: var(--font-latin); }
.rh-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.rh-grid > div { background: var(--violet-50); border-radius: var(--radius-md); padding: 10px 6px; text-align: center; }
.rh-grid .v { display: block; font-size: 18px; font-weight: 800; color: var(--violet-700); font-family: var(--font-latin); }
.rh-grid .l { font-size: 10.5px; color: var(--fg-muted); }
.rh-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }

/* --- مفتاح المؤثرات الصوتية --- */
.sound-card { padding: 16px; }
.sc-row { display: flex; align-items: center; gap: 12px; }
.sc-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--violet-50); color: var(--violet-600); display: flex; align-items: center; justify-content: center; flex: none; }
.sc-body { flex: 1; } .sc-body b { display: block; color: var(--fg-heading); font-size: 15px; } .sc-body span { font-size: 12.5px; color: var(--fg-muted); }
.sc-note { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-size: 12.5px; color: var(--fg-muted); background: var(--violet-50); border-radius: var(--radius-md); padding: 9px 12px; }
.switch { width: 50px; height: 30px; border-radius: 999px; background: var(--neutral-300); position: relative; transition: background var(--dur-base) var(--ease-out); flex: none; }
.switch .knob { position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--dur-base) var(--ease-out); }
.switch.on { background: var(--green-500); }
.switch.on .knob { transform: translateX(-20px); }
html[dir="rtl"] .switch.on .knob { transform: translateX(-20px); }

/* --- ملاحظات داخل اللوح --- */
.sheet-note { display: flex; gap: 8px; align-items: flex-start; background: var(--violet-50); color: var(--violet-700); border-radius: var(--radius-md); padding: 11px 13px; font-size: 13px; line-height: 1.6; margin-bottom: 14px; }

/* --- خريطة المراحل: المفتاح + وضع المراجعة --- */
.map-legend { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 4px 0 8px; font-size: 12.5px; color: var(--fg-muted); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend .lg { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.map-legend .lg.play { background: var(--orange-400); }
.map-legend .lg.review { background: var(--violet-300); }
.map-legend .lg.locked { background: var(--neutral-300); }
.lvl-node.review { background: var(--violet-100) !important; border-color: var(--violet-300) !important; color: var(--violet-700) !important; opacity: 1 !important; }
.lvl-node .lvl-rev { position: absolute; inset-block-end: -4px; inset-inline-end: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--violet-500); color: #fff; display: flex; align-items: center; justify-content: center; }

/* --- تبويبات مقسّمة --- */
.seg-tabs { display: flex; background: var(--surface-2); border-radius: var(--radius-pill); padding: 4px; gap: 4px; margin-bottom: 14px; }
.seg-tabs button { flex: 1; border-radius: var(--radius-pill); padding: 9px 12px; font-size: 13px; font-weight: 700; color: var(--fg-muted); transition: all var(--dur-base) var(--ease-out); }
.seg-tabs button.on { background: var(--surface); color: var(--violet-700); box-shadow: var(--shadow-sm); }
.lb-note { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--violet-700); background: var(--violet-50); border-radius: var(--radius-md); padding: 9px 12px; margin-bottom: 12px; }

/* --- إدارة الجولات (آدمن) --- */
.rounds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.round-admin { padding: 18px; }
.ra-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ra-head b { font-family: var(--font-display); color: var(--fg-heading); font-size: 17px; }
.ra-desc { margin: 8px 0 0; font-size: 13px; color: var(--fg-muted); }
.ra-meta { display: grid; gap: 7px; margin: 14px 0; }
.ra-meta > div { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg); }
.ra-meta svg { color: var(--violet-500); flex: none; }
.ra-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ra-kpis > div { text-align: center; } .ra-kpis .v { display: block; font-size: 18px; font-weight: 800; color: var(--violet-700); font-family: var(--font-latin); } .ra-kpis .l { font-size: 11px; color: var(--fg-muted); }
.ra-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ra-gh { cursor: pointer; } .ra-gh .gc { width: 11px; height: 11px; border-radius: 50%; display: inline-block; margin-inline-end: 6px; }
.rk-stat b { display: block; font-family: var(--font-display); color: var(--fg-heading); font-size: 16px; } .rk-stat span { font-size: 12.5px; color: var(--fg-muted); font-family: var(--font-latin); }

/* --- شريط الجولة في لوحة الآدمن --- */
.admin-round-strip { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow-sm); margin-bottom: 20px; flex-wrap: wrap; }
.admin-round-strip.none { border-style: dashed; }
.admin-round-strip .ars-ic { width: 42px; height: 42px; border-radius: 13px; background: var(--green-50); color: var(--green-500); display: flex; align-items: center; justify-content: center; flex: none; }
.admin-round-strip.none .ars-ic { background: var(--violet-50); color: var(--violet-600); }
.admin-round-strip .ars-body { flex: 1; min-width: 180px; } .admin-round-strip .ars-body b { display: block; color: var(--fg-heading); font-size: 15px; } .admin-round-strip .ars-body span { font-size: 12.5px; color: var(--fg-muted); font-family: var(--font-latin); }

/* --- نتائج الجولة (آدمن) --- */
.result-head-admin h2 { font-family: var(--font-display); color: var(--fg-heading); margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.win-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); }
.win-card .wc-ic { width: 50px; height: 50px; border-radius: 16px; color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.win-card .l { display: block; font-size: 12px; color: var(--fg-muted); } .win-card b { display: block; font-family: var(--font-display); color: var(--fg-heading); font-size: 17px; } .win-card .num { font-size: 13px; color: var(--violet-600); }

/* --- اختيار الجولات (تراكمي) --- */
.round-pick { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-pill); border: 1.5px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--fg-muted); transition: all var(--dur-base) var(--ease-out); }
.round-pick.on { border-color: var(--violet-500); background: var(--violet-50); color: var(--violet-700); }

/* --- نموذج الجولة: اختيار النطاق --- */
.radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rsel { border: 1.5px solid var(--border-strong); border-radius: var(--radius-md); padding: 12px; cursor: pointer; display: block; transition: all var(--dur-base) var(--ease-out); }
.rsel.on { border-color: var(--violet-500); background: var(--violet-50); }
.rsel input { margin-inline-end: 6px; } .rsel b { font-size: 13.5px; color: var(--fg-heading); } .rsel span { display: block; font-size: 12px; color: var(--fg-muted); margin-top: 4px; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--fg); cursor: pointer; }
.check-inline input { width: 18px; height: 18px; }

/* --- إعدادات الأصوات (معاينة) --- */
.sfx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.sfx-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow-sm); text-align: start; transition: all var(--dur-base) var(--ease-out); }
.sfx-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--violet-300); }
.sfx-card .sfx-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--grad-ribbon); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.sfx-card b { display: block; font-size: 13.5px; color: var(--fg-heading); }

/* --- سجل العمليات --- */
.audit-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }

@media (max-width: 540px) {
  .rb-stats, .rh-grid { grid-template-columns: repeat(2, 1fr); }
  .radio-row { grid-template-columns: 1fr; }
}

/* --- لوحة النتائج الموحّدة (آدمن) --- */
.res-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px; }
.res-filters .field { margin: 0; flex: 1; min-width: 180px; }
.res-filters .field label { display: block; font-size: 12px; font-weight: 700; color: var(--fg-muted); margin-bottom: 6px; }
.res-scope { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--fg-muted); }
.res-scope .chip { font-weight: 700; }
.medal { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-family: var(--font-latin); font-weight: 800; font-size: 13px; flex: none; box-shadow: var(--shadow-xs); }
.medal.m1 { background: linear-gradient(145deg, #F7C948, #E0A011); }
.medal.m2 { background: linear-gradient(145deg, #C7CDD6, #99A1AE); }
.medal.m3 { background: linear-gradient(145deg, #D89766, #B5703E); }
.lb-row.top1 { border-color: #E9B949; background: linear-gradient(90deg, color-mix(in oklab, #F7C948 14%, var(--surface)), var(--surface)); box-shadow: var(--shadow-sm); }
.lb-row.top2 { border-color: #B6BdC7; background: color-mix(in oklab, #C7CDD6 12%, var(--surface)); }
.lb-row.top3 { border-color: #D89766; background: color-mix(in oklab, #D89766 11%, var(--surface)); }
.tbl tr.top1 td { background: color-mix(in oklab, #F7C948 13%, var(--surface)); }
.tbl tr.top2 td { background: color-mix(in oklab, #C7CDD6 11%, var(--surface)); }
.tbl tr.top3 td { background: color-mix(in oklab, #D89766 10%, var(--surface)); }
.gwin-card { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-xs); }
.gwin-card .gw-bar { width: 5px; align-self: stretch; border-radius: 4px; flex: none; }
.gwin-card .gw-nm { font-size: 12px; color: var(--fg-muted); }
.gwin-card .gw-win b { color: var(--fg-heading); font-size: 14.5px; }

/* ============================================================
   لوحة الفائزين — Winners Board (dark, fullscreen-capable)
   ============================================================ */
.wboard {
  --wb-scale: 1;
  position: relative; border-radius: var(--radius-xl); overflow: hidden;
  padding: 26px 26px 30px;
  color: #fff;
  background:
    radial-gradient(1100px 560px at 74% -12%, rgba(151,86,192,.55), transparent 60%),
    radial-gradient(820px 520px at 6% 8%, rgba(53,101,174,.40), transparent 62%),
    radial-gradient(700px 700px at 96% 108%, rgba(255,122,0,.20), transparent 60%),
    linear-gradient(158deg, #2c1552 0%, #1d1039 62%, #170c2e 100%);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}
.wboard.wb-full {
  position: fixed; inset: 0; z-index: 1000; border-radius: 0;
  padding: clamp(20px, 3.2vw, 54px);
  overflow: auto; --wb-scale: 1.18;
}
:fullscreen .wboard, .wboard:fullscreen { border-radius: 0; }

.wb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.wb-title { display: flex; align-items: center; gap: 13px; min-width: 0; }
.wb-title img { height: 40px; width: auto; flex: none; filter: drop-shadow(0 3px 10px rgba(0,0,0,.35)); }
.wb-title .wb-h { font-family: var(--font-display); font-weight: 900; font-size: calc(26px * var(--wb-scale)); line-height: 1.1; margin: 0; letter-spacing: -.5px; }
.wb-title .wb-sub { font-size: calc(13px * var(--wb-scale)); color: rgba(255,255,255,.62); margin-top: 3px; font-weight: 500; }
.wb-actions { display: flex; gap: 9px; flex: none; }
.wb-btn { display: inline-flex; align-items: center; gap: 7px; border: 0; cursor: pointer; font-family: inherit;
  font-weight: 800; font-size: 14px; padding: 11px 18px; border-radius: var(--radius-pill); transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base), background var(--dur-base); }
.wb-btn:active { transform: scale(.96); }
.wb-btn.primary { background: var(--grad-warm); color: #fff; box-shadow: 0 8px 22px rgba(255,122,0,.4); }
.wb-btn.primary:hover { box-shadow: 0 10px 28px rgba(255,122,0,.55); }
.wb-btn.ghost { background: rgba(255,255,255,.1); color: #fff; }
.wb-btn.ghost:hover { background: rgba(255,255,255,.18); }
.wb-btn svg { width: 17px; height: 17px; }

/* filter bar */
.wb-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 20px;
  background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.09); border-radius: var(--radius-pill);
  padding: 10px 16px; backdrop-filter: blur(6px); }
.wbf-group { display: flex; align-items: center; gap: 7px; }
.wbf-group + .wbf-group { padding-inline-start: 16px; border-inline-start: 1px solid rgba(255,255,255,.12); }
.wbf-label { font-size: 12px; font-weight: 700; color: rgba(255,255,255,.5); }
.wbf-pill { border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); color: rgba(255,255,255,.78);
  font-family: inherit; font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: var(--radius-pill); cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out); white-space: nowrap; }
.wbf-pill:hover { background: rgba(255,255,255,.12); color: #fff; }
.wbf-pill.on { background: #fff; color: var(--violet-800); border-color: #fff; }
.wbf-pill.on-orange { background: var(--orange-500); color: #fff; border-color: var(--orange-500); box-shadow: 0 4px 14px rgba(255,122,0,.4); }
.wbf-pill.on-blue { background: var(--blue-500); color: #fff; border-color: var(--blue-500); box-shadow: 0 4px 14px rgba(53,101,174,.4); }

/* podium */
.wb-podium { display: flex; direction: ltr; align-items: flex-end; justify-content: center; gap: clamp(14px, 2.4vw, 34px);
  margin: calc(40px * var(--wb-scale)) auto calc(26px * var(--wb-scale)); max-width: 820px; }
.wb-col { display: flex; flex-direction: column; align-items: center; flex: 1; max-width: 240px; min-width: 0; }
.wb-nm { font-family: var(--font-display); font-weight: 800; font-size: calc(19px * var(--wb-scale)); color: #fff; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wb-grp { font-size: calc(12.5px * var(--wb-scale)); color: rgba(255,255,255,.55); margin-top: 2px; margin-bottom: 12px; text-align: center; }
.wb-av { border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 900;
  font-family: var(--font-display); box-shadow: 0 10px 30px rgba(0,0,0,.4); border: 3px solid rgba(255,255,255,.16); flex: none; }
.wb-bar { position: relative; width: 100%; border-radius: 20px 20px 0 0; margin-top: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 -6px 30px rgba(0,0,0,.25) inset, 0 12px 30px rgba(0,0,0,.3); }
.wb-rank { position: absolute; top: 0; left: 50%; transform: translate(-50%, -52%); width: calc(46px * var(--wb-scale)); height: calc(46px * var(--wb-scale));
  border-radius: 50%; background: #fff; color: var(--violet-800); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-latin); font-weight: 900; font-size: calc(19px * var(--wb-scale)); box-shadow: 0 6px 16px rgba(0,0,0,.3); border: 3px solid rgba(255,255,255,.85); }
.wb-val { font-family: var(--font-latin); font-weight: 900; font-size: calc(40px * var(--wb-scale)); color: #3a2410; line-height: 1; }
.wb-unit { font-size: calc(12.5px * var(--wb-scale)); font-weight: 700; color: rgba(58,36,16,.62); margin-top: 6px; }
.wb-col.p1 .wb-av { width: calc(78px * var(--wb-scale)); height: calc(78px * var(--wb-scale)); font-size: calc(30px * var(--wb-scale)); }
.wb-col.p2 .wb-av, .wb-col.p3 .wb-av { width: calc(64px * var(--wb-scale)); height: calc(64px * var(--wb-scale)); font-size: calc(25px * var(--wb-scale)); }
.wb-col.p1 .wb-bar { height: calc(232px * var(--wb-scale)); background: linear-gradient(180deg, #FFCB52 0%, #F5A623 100%); }
.wb-col.p2 .wb-bar { height: calc(184px * var(--wb-scale)); background: linear-gradient(180deg, #EDE9F4 0%, #C4BDD6 100%); }
.wb-col.p3 .wb-bar { height: calc(150px * var(--wb-scale)); background: linear-gradient(180deg, #F0A968 0%, #DB8038 100%); }
.wb-col.p1 .wb-rank { color: #B26a00; }
.wb-col.p1 .wb-av { border-color: rgba(255,203,82,.6); }

/* ranked list */
.wb-list { display: flex; flex-direction: column; gap: 10px; max-width: 940px; margin: 0 auto; }
.wb-lrow { display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-lg); padding: 13px 20px; transition: background var(--dur-fast); }
.wb-lrow:hover { background: rgba(255,255,255,.1); }
.wb-lrow .lrk { font-family: var(--font-latin); font-weight: 900; font-size: calc(19px * var(--wb-scale)); color: rgba(255,255,255,.85); width: 34px; text-align: center; flex: none; }
.wb-lav { border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800;
  font-family: var(--font-display); flex: none; border: 2px solid rgba(255,255,255,.14); }
.wb-lrow .lnm { flex: 1; min-width: 0; font-family: var(--font-display); font-weight: 800; font-size: calc(17px * var(--wb-scale)); color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-lrow .lgrp { font-size: calc(13px * var(--wb-scale)); color: rgba(255,255,255,.5); flex: none; }
.wb-lrow .lval { font-family: var(--font-latin); font-weight: 900; font-size: calc(21px * var(--wb-scale)); color: var(--orange-400); flex: none; min-width: 56px; text-align: start; }
.wb-empty { text-align: center; color: rgba(255,255,255,.6); padding: 40px 0; }
.wb-empty svg { width: 34px; height: 34px; opacity: .7; margin-bottom: 8px; }

@media (max-width: 720px) {
  .wb-head { flex-direction: column; }
  .wb-actions { align-self: flex-end; }
  .wb-filters { gap: 8px 10px; }
  .wbf-group + .wbf-group { padding-inline-start: 0; border-inline-start: 0; }
  .wboard { --wb-scale: .78; }
  .wb-lrow .lgrp { display: none; }
}
