/* ============ تحدي NADDAF RC ============ */
:root {
  --orange: #e8741e;
  --orange-2: #ff9a3c;
  --black: #111111;
  --white: #ffffff;
  --wa: #25d366;
  --glass: rgba(17, 17, 17, 0.62);
  --glass-2: rgba(17, 17, 17, 0.78);
  --line: rgba(255, 255, 255, 0.14);
  --text-2: rgba(255, 255, 255, 0.72);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--black); color: var(--white); overflow: hidden; }
body { font-family: 'Cairo', system-ui, sans-serif; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

#app { position: fixed; inset: 0; overflow: hidden; background: #1a120c; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#cloudfog { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at 50% 45%, rgba(255, 238, 220, 0.75), rgba(255, 226, 200, 0.97) 70%); }
#cloudfog.dust { background: radial-gradient(ellipse at 50% 45%, rgba(214, 160, 96, 0.55), rgba(176, 116, 58, 0.95) 75%); }
#glow { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 0.25s; box-shadow: inset 0 0 90px 20px rgba(255, 120, 30, 0.75); }
#grade { position: absolute; z-index: 8; top: 22%; left: 50%; transform: translate(-50%, 0) scale(0.3); opacity: 0; pointer-events: none; text-align: center; transition: transform 0.35s cubic-bezier(0.3, 1.8, 0.5, 1), opacity 0.3s; }
#grade.show { transform: translate(-50%, 0) scale(1); opacity: 1; }
#grade b { display: block; font-size: 110px; line-height: 1; font-weight: 900; font-style: italic; text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6); }
#grade span { font-size: 26px; font-weight: 900; color: #fff; text-shadow: 0 2px 8px #000; }
#grade.g-S b { color: #ffd23a; text-shadow: 0 0 30px rgba(255, 200, 40, 0.9), 0 4px 0 #b36b00; }
#grade.g-A b { color: #ff9a3c; }
#grade.g-B b { color: #8fdcff; }
#grade.g-C b { color: #cfcfcf; }
#grade.g-D b { color: #ff5a4a; }
#vignette { position: absolute; inset: 0; pointer-events: none; z-index: 1; background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.45) 100%); }

/* ---------- الشريط العلوي ---------- */
#topbar { position: absolute; z-index: 6; top: calc(12px + var(--safe-t)); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; direction: ltr; pointer-events: none; }
.rc-badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border-radius: 999px; background: rgba(20, 16, 12, 0.66); border: 1.5px solid rgba(232, 116, 30, 0.75); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); font-weight: 700; font-size: 15px; direction: ltr; white-space: nowrap; }
.rc-badge .rc { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--orange); color: #fff; font-size: 10px; font-weight: 900; letter-spacing: 0.02em; }
.brand { height: 34px; width: auto; padding: 4px 8px; border-radius: 9px; background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); }

/* ---------- لوحة المعلومات ---------- */
#hud { position: absolute; z-index: 5; top: calc(58px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(420px, calc(100% - 116px)); pointer-events: none; }
.hud-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.hud-box { justify-self: start; padding: 4px 10px; border-radius: 12px; background: var(--glass); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); line-height: 1.15; min-width: 70px; }
.hud-box small { display: block; font-size: 10px; color: var(--text-2); font-weight: 600; }
.hud-box b { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.hud-box.extra { justify-self: end; font-size: 12px; font-weight: 700; padding: 8px 10px; min-width: 0; white-space: nowrap; }
.hud-box.extra.alert { background: rgba(210, 40, 30, 0.85); animation: pulse 0.4s infinite alternate; }
.hud-time { grid-column: 2; min-width: 64px; padding: 2px 14px; text-align: center; border-radius: 14px; background: var(--glass-2); border: 1.5px solid var(--line); font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; }
.hud-time.low { color: #ff5a4a; border-color: #ff5a4a; animation: pulse 0.6s infinite alternate; }
.hud-progress { margin-top: 8px; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.4); overflow: hidden; direction: ltr; }
.hud-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--orange), var(--orange-2)); border-radius: 3px; transition: width 0.2s linear; }
.meter { position: absolute; z-index: 5; top: calc(132px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(220px, 60%); text-align: center; pointer-events: none; }
.meter span { font-size: 12px; font-weight: 800; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); }
.meter .bar { height: 8px; margin-top: 2px; border-radius: 5px; background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line); overflow: hidden; direction: ltr; }
.meter .bar i { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--orange); transition: width 0.12s linear, background 0.2s; }
.meter.ok .bar i { background: #3ccf6b; }
.meter.warn .bar i { background: #ffc53d; }
.meter.danger .bar i { background: #ff4a3d; }
.meter.danger span { color: #ff6a5d; }

#popups { position: absolute; z-index: 7; top: 34%; left: 0; right: 0; height: 0; pointer-events: none; }
.popup { position: absolute; left: 50%; top: 0; transform: translate(calc(-50% + var(--x)), 0); font-size: 26px; font-weight: 900; white-space: nowrap; text-shadow: 0 3px 10px rgba(0, 0, 0, 0.7), 0 0 2px #000; animation: rise 1.3s ease-out forwards; }
.popup.gold { color: #ffc84a; }
.popup.red { color: #ff5a4a; }
.popup.orange { color: var(--orange-2); }
#hint { position: absolute; z-index: 7; top: 44%; left: 50%; transform: translateX(-50%); padding: 10px 18px; border-radius: 14px; background: var(--orange); font-weight: 900; font-size: 18px; text-align: center; box-shadow: 0 6px 24px rgba(232, 116, 30, 0.5); animation: pulse 0.5s infinite alternate; pointer-events: none; width: max-content; max-width: 90%; }
#ctrl-hint { position: absolute; z-index: 7; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.9); display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: min(420px, 90%); opacity: 0; transition: 0.35s; pointer-events: none; }
#ctrl-hint.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#ctrl-hint span { padding: 8px 14px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); font-weight: 700; font-size: 15px; }
#countdown { position: absolute; z-index: 9; inset: 0; display: grid; place-items: center; font-size: clamp(90px, 28vw, 170px); font-weight: 900; color: #fff; text-shadow: 0 8px 40px rgba(232, 116, 30, 0.8), 0 2px 0 var(--orange); pointer-events: none; }
#countdown.pop { animation: cd 0.8s ease-out; }

/* ---------- أزرار اللمس ---------- */
#touch { position: absolute; z-index: 6; inset: 0; pointer-events: none; }
.pad { position: absolute; bottom: calc(22px + var(--safe-b)); display: flex; gap: 14px; align-items: flex-end; pointer-events: auto; touch-action: none; direction: ltr; padding: 10px; }
.pad-left { left: 8px; }
.pad-right { right: 8px; }
.pad button { width: 78px; height: 78px; border-radius: 50%; background: rgba(17, 17, 17, 0.42); border: 2px solid rgba(255, 255, 255, 0.35); font-size: 26px; font-weight: 800; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); transition: transform 0.08s, background 0.08s; touch-action: none; }
.pad button.small { width: 64px; height: 64px; font-size: 14px; }
.pad button.accent { width: 94px; height: 94px; font-size: 17px; background: rgba(232, 116, 30, 0.55); border-color: rgba(255, 190, 130, 0.8); }
.pad button.on { transform: scale(0.92); background: rgba(232, 116, 30, 0.85); }
.pad-right.grid { display: grid; grid-template-columns: auto auto; gap: 10px; align-items: end; justify-items: center; }
.pad button.alert { background: rgba(37, 211, 102, 0.75); border-color: #fff; animation: pulse 0.5s infinite alternate; }
.joy-zone { position: absolute; left: 0; bottom: 0; width: 60%; height: 60%; pointer-events: auto; touch-action: none; }
.joy-base { position: absolute; left: 96px; top: calc(100% - 118px - var(--safe-b)); width: 128px; height: 128px; margin: -64px 0 0 -64px; border-radius: 50%; background: rgba(17, 17, 17, 0.35); border: 2px solid rgba(255, 255, 255, 0.35); display: grid; place-items: center; opacity: 0.75; }
.joy-base.on { opacity: 1; }
.joy-knob { width: 58px; height: 58px; border-radius: 50%; background: rgba(232, 116, 30, 0.85); border: 2px solid #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); }

/* ---------- أزرار النظام ---------- */
#sys { position: absolute; z-index: 12; top: calc(58px + var(--safe-t)); right: 12px; display: flex; flex-direction: column; gap: 8px; }
#sys button { width: 40px; height: 40px; border-radius: 50%; background: var(--glass); border: 1px solid var(--line); display: grid; place-items: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#sys svg { width: 20px; height: 20px; }

/* ---------- الشاشات ---------- */
#screen { position: absolute; z-index: 10; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px calc(16px + var(--safe-b)); pointer-events: none; }
#screen.result-screen, #screen.pause-screen { align-items: center; background: rgba(0, 0, 0, 0.35); pointer-events: auto; }
#screen .panel { pointer-events: auto; width: min(460px, 100%); padding: 20px 20px 18px; border-radius: 24px; background: var(--glass-2); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); text-align: center; max-height: 100%; overflow-y: auto; }
.panel.in { animation: up 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.panel h1 { margin: 6px 0 2px; font-size: clamp(26px, 7vw, 34px); font-weight: 900; line-height: 1.2; }
.panel h2 { margin: 2px 0 6px; font-size: clamp(24px, 6.5vw, 30px); font-weight: 900; }
.panel .sub { margin: 0 0 12px; color: var(--text-2); font-size: 14px; }
.logo-card { height: 54px; width: auto; margin: 0 auto 6px; padding: 8px 14px; border-radius: 14px; background: #fff; border-bottom: 4px solid var(--orange); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); }
.stage-no { display: inline-block; padding: 3px 12px; border-radius: 999px; background: rgba(232, 116, 30, 0.18); color: var(--orange-2); font-size: 13px; font-weight: 800; }
.challenge { margin: 4px 0 10px; font-size: 15.5px; line-height: 1.7; }
.goals { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; text-align: start; }
.goals li { padding: 7px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); font-size: 14px; font-weight: 600; }
.goals li::before { content: '◆'; color: var(--orange); margin-inline-end: 8px; font-size: 11px; }
.best { margin: 10px 0 0; color: var(--text-2); font-size: 13px; }
.best b { color: #fff; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin-top: 10px; padding: 10px 18px; border-radius: 16px; font-weight: 800; font-size: 16px; transition: transform 0.1s, filter 0.2s; }
.btn:active { transform: scale(0.97); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.big { min-height: 58px; font-size: 19px; }
.btn.primary { background: linear-gradient(180deg, var(--orange-2), var(--orange)); box-shadow: 0 8px 24px rgba(232, 116, 30, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3); color: #fff; }
.btn.ghost { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); }
.btn.gold { background: linear-gradient(180deg, #ffd25a, #f0a01e); color: #2a1600; }
.btn.link { min-height: 36px; margin-top: 4px; background: none; color: var(--text-2); font-weight: 700; font-size: 14px; }
.btn.mini { display: inline-flex; width: auto; min-height: 32px; margin-top: 6px; padding: 4px 16px; font-size: 13px; border-radius: 999px; background: var(--black); color: #fff; }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }

.stage-dots { display: flex; justify-content: center; gap: 8px; margin: 6px 0 4px; direction: rtl; }
.sd { display: grid; justify-items: center; gap: 2px; padding: 6px 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); min-width: 64px; }
.sd .ic { font-size: 22px; }
.sd.locked { opacity: 0.4; }
.st { color: #ffc84a; font-size: 13px; letter-spacing: 1px; }
.st em { color: rgba(255, 255, 255, 0.2); font-style: normal; }
.stage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.stage-card { display: grid; justify-items: center; gap: 2px; padding: 12px 8px; border-radius: 18px; background: rgba(255, 255, 255, 0.07); border: 1.5px solid var(--line); transition: transform 0.1s; }
.stage-card:active { transform: scale(0.97); }
.stage-card:not(.locked):hover { border-color: var(--orange); }
.stage-card .ic { font-size: 30px; }
.stage-card .no { font-size: 12px; color: var(--orange-2); font-weight: 800; }
.stage-card b { font-size: 15px; }
.stage-card small { color: var(--text-2); font-size: 12px; }
.stage-card.locked { opacity: 0.45; cursor: not-allowed; }
.stage-card .st svg { width: 12px; height: 12px; vertical-align: -1px; }

.result .stars { display: flex; justify-content: center; gap: 6px; margin: 4px 0; direction: ltr; }
.result .stars i { font-style: normal; font-size: 52px; line-height: 1; color: rgba(255, 255, 255, 0.15); }
.result .stars i.on { color: #ffc84a; text-shadow: 0 0 18px rgba(255, 200, 74, 0.7); animation: star 0.5s var(--d) cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.result .big-score { font-size: 44px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.result .lbl { color: var(--text-2); font-size: 13px; margin-top: -2px; }
.result.fail h2 { color: #ff7a5a; }
.details { display: grid; gap: 4px; margin: 12px 0 0; text-align: start; }
.details div { display: flex; justify-content: space-between; padding: 6px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); font-size: 14px; }
.details b { font-variant-numeric: tabular-nums; }

/* ---------- الشاشة الختامية ---------- */
#screen.finale-screen { align-items: stretch; padding: 0; pointer-events: auto; }
.finale { width: 100%; height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; background: linear-gradient(180deg, rgba(20, 12, 6, 0.35), rgba(20, 12, 6, 0.75) 35%, rgba(12, 8, 4, 0.9)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); user-select: text; }
.fin-card { width: min(460px, 100%); margin: 0 auto; padding: calc(22px + var(--safe-t)) 16px calc(28px + var(--safe-b)); text-align: center; }
.fin-card h1 { margin: 10px 0 4px; font-size: clamp(24px, 7vw, 32px); font-weight: 900; }
.fin-stars { display: inline-flex; align-items: baseline; gap: 4px; color: #ffc84a; direction: ltr; }
.fin-stars b { font-size: 40px; font-weight: 900; }
.fin-stars span { font-size: 18px; font-weight: 800; }
.fin-score { color: var(--text-2); font-size: 14px; }
.fin-score b { color: #fff; }
.improve { margin: 4px 0 0; font-size: 13px; color: var(--orange-2); font-weight: 700; }

.gift { position: relative; height: 190px; margin: 14px auto 4px; display: grid; place-items: center; cursor: pointer; }
.gift-box { position: relative; width: 120px; height: 96px; margin-top: 30px; background: linear-gradient(180deg, var(--orange-2), var(--orange)); border-radius: 10px; box-shadow: 0 16px 40px rgba(232, 116, 30, 0.45); animation: wobble 1.6s ease-in-out infinite; transition: transform 0.4s, opacity 0.4s; }
.gift-box .ribbon { position: absolute; left: 50%; top: 0; bottom: 0; width: 18px; margin-left: -9px; background: #111; }
.gift-box .lid { position: absolute; left: -8px; right: -8px; top: -26px; height: 28px; border-radius: 8px; background: linear-gradient(180deg, #ffb060, var(--orange-2)); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15); transition: transform 0.5s cubic-bezier(0.3, 1.5, 0.5, 1), opacity 0.5s; }
.gift-box .lid::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 18px; margin-left: -9px; background: #111; }
.gift-box .lid::after { content: ''; position: absolute; left: 50%; top: -20px; width: 44px; height: 22px; margin-left: -22px; border: 6px solid #111; border-bottom: 0; border-radius: 22px 22px 0 0; }
.gift-hint { position: absolute; bottom: 0; font-weight: 800; font-size: 14px; color: var(--orange-2); animation: pulse 0.7s infinite alternate; }
.code-card { position: absolute; inset: 10px 8% 0; display: grid; place-content: center; gap: 0; padding: 12px; border-radius: 20px; background: #fff; color: var(--black); border-bottom: 5px solid var(--orange); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 0 0 60px rgba(255, 200, 74, 0.35); transform: scale(0.2) rotate(-8deg); opacity: 0; pointer-events: none; transition: transform 0.6s 0.25s cubic-bezier(0.3, 1.6, 0.5, 1), opacity 0.3s 0.25s; }
.code-card small { font-weight: 700; color: #555; }
.code-card .code { font-size: 36px; font-weight: 900; letter-spacing: 2px; color: var(--black); user-select: all; }
.code-card .pct { font-weight: 900; color: var(--orange); font-size: 18px; margin-top: -4px; }
.gift.open .lid { transform: translate(40px, -90px) rotate(35deg); opacity: 0; }
.gift.open .gift-box { transform: scale(0.6) translateY(60px); opacity: 0; animation: none; }
.gift.open .gift-hint { display: none; }
.gift.open .code-card { transform: none; opacity: 1; pointer-events: auto; }

.btn.wa { margin-top: 16px; background: linear-gradient(180deg, #3be07a, var(--wa)); color: #fff; box-shadow: 0 10px 30px rgba(37, 211, 102, 0.45); text-align: center; line-height: 1.35; }
.btn.wa svg { width: 28px; height: 28px; }
.btn.wa.nudge { animation: nudge 0.5s; }
.more { margin: 26px 0 2px; font-size: 22px; font-weight: 900; }
.more em { font-style: normal; color: var(--orange); }
.pick-hint { margin: 0 0 10px; color: var(--text-2); font-size: 13px; }
.products { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.product { position: relative; display: grid; gap: 2px; padding: 8px 8px 10px; border-radius: 14px; background: #fff; color: var(--black); border-bottom: 4px solid var(--orange); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); cursor: pointer; transition: transform 0.12s, box-shadow 0.2s; }
.product:active { transform: scale(0.97); }
.product.sel { box-shadow: 0 0 0 3px var(--orange), 0 8px 24px rgba(232, 116, 30, 0.5); }
.product.sel::after { content: '✓'; position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 14px; }
.pimg { aspect-ratio: 1.35; display: grid; place-items: center; overflow: hidden; }
.pimg img { max-height: 100%; object-fit: contain; }
.pname { font-weight: 800; font-size: 13.5px; }
.pview { font-size: 12px; font-weight: 700; color: var(--orange); }

.contact { display: grid; justify-items: center; gap: 10px; margin: 24px 0 8px; }
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); border: 1.5px solid rgba(232, 116, 30, 0.55); font-weight: 800; font-size: 17px; direction: ltr; }
.pill svg { width: 26px; height: 26px; }
.wa-pill { border-color: var(--wa); box-shadow: 0 0 16px rgba(37, 211, 102, 0.3); }
.wa-pill svg { color: #fff; background: var(--wa); border-radius: 50%; padding: 3px; width: 32px; height: 32px; }
.social a { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: #fff; }
.social a.ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.social a.fb { background: #1877f2; border-radius: 50%; }
.social a svg { width: 20px; height: 20px; }
.web i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--orange); }
.web i svg { width: 20px; height: 20px; }
.delivery { padding: 6px 18px; border-radius: 999px; background: linear-gradient(180deg, var(--orange-2), var(--orange)); font-weight: 800; font-size: 15px; }

/* ---------- عناصر عامة ---------- */
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 11; pointer-events: none; }
#fade { position: absolute; inset: 0; z-index: 20; background: #0b0806; opacity: 0; pointer-events: none; transition: opacity 0.4s; }
#fade.on { opacity: 1; }
#flash { position: absolute; inset: 0; z-index: 19; background: #fff; opacity: 0; pointer-events: none; }
#flash.on { animation: flash 0.6s ease-out; }
#toast { position: absolute; z-index: 25; bottom: calc(120px + var(--safe-b)); left: 50%; transform: translate(-50%, 20px); padding: 10px 18px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); font-weight: 700; opacity: 0; transition: 0.3s; pointer-events: none; white-space: nowrap; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

#loader { position: absolute; inset: 0; z-index: 30; display: grid; place-content: center; justify-items: center; gap: 22px; background: radial-gradient(ellipse at 50% 40%, #3a220f, #0b0806 70%); transition: opacity 0.6s; }
#loader.gone { opacity: 0; pointer-events: none; }
.load-card { padding: 14px 22px; border-radius: 18px; background: #fff; border-bottom: 5px solid var(--orange); box-shadow: 0 20px 60px rgba(232, 116, 30, 0.25); animation: float 2s ease-in-out infinite; }
.load-card img { height: 64px; width: auto; }
.load-bar { width: 220px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; direction: ltr; }
.load-bar i { display: block; height: 100%; width: 8%; background: linear-gradient(90deg, var(--orange), var(--orange-2)); border-radius: 4px; transition: width 0.3s; }
#load-text { margin: 0; color: var(--text-2); font-weight: 600; }
.noscript { position: absolute; inset: 0; display: grid; place-items: center; z-index: 40; background: #111; }

/* ---------- حركات ---------- */
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { 0% { opacity: 0; transform: translate(calc(-50% + var(--x)), 10px) scale(0.7); } 15% { opacity: 1; transform: translate(calc(-50% + var(--x)), 0) scale(1.1); } 100% { opacity: 0; transform: translate(calc(-50% + var(--x)), -70px) scale(1); } }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.6; } }
@keyframes cd { 0% { transform: scale(2.2); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 100% { transform: scale(0.85); opacity: 0.9; } }
@keyframes star { from { transform: scale(0) rotate(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-4deg) translateY(-3px); } 40% { transform: rotate(4deg); } 60% { transform: rotate(-2deg); } }
@keyframes nudge { 0%, 100% { transform: none; } 30% { transform: scale(1.04); } 60% { transform: scale(0.98); } }
@keyframes flash { from { opacity: 0.85; } to { opacity: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- الوضع الأفقي والشاشات القصيرة ---------- */
@media (max-height: 520px) {
  #hud { top: calc(10px + var(--safe-t)); width: min(360px, 50%); }
  .meter { top: calc(80px + var(--safe-t)); }
  #sys { top: calc(56px + var(--safe-t)); flex-direction: row; }
  .pad button { width: 64px; height: 64px; }
  .pad button.accent { width: 78px; height: 78px; }
  #screen .panel { padding: 14px 16px; }
  .logo-card { height: 42px; }
  .goals { grid-template-columns: 1fr 1fr 1fr; }
  .btn.big { min-height: 48px; }
}
@media (min-width: 900px) {
  #screen:not(.finale-screen) { align-items: center; justify-content: flex-start; padding-inline-start: 6vw; }
  #screen.result-screen, #screen.pause-screen { justify-content: center; padding-inline-start: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* زر المتجر في الشاشة الختامية (الرئيسي) — واتساب أصبح خياراً ثانوياً */
#shop-btn { margin-top: 16px; width: 100%; text-align: center; line-height: 1.35; }
#shop-btn.nudge { animation: nudge 0.5s; }
.finale #shop-btn + .pick-hint { margin: 8px 0 0; }
.finale .btn.wa { min-height: 46px; font-size: 15px; box-shadow: none; opacity: 0.92; }
.finale .btn.wa svg { width: 22px; height: 22px; }

/* نموذج الاسم في الشاشة الختامية — الكود الشخصي (KHALED5) */
.claim { margin: 18px 0 6px; padding: 18px 16px; border-radius: 22px; background: rgba(255, 255, 255, 0.06); border: 1.5px solid rgba(232, 116, 30, 0.55); }
.claim[hidden], #after-code[hidden] { display: none !important; }
.claim-title { margin: 0 0 6px; font-weight: 800; font-size: 17px; }
.claim-pct { display: inline-block; margin-bottom: 12px; padding: 4px 14px; border-radius: 999px; background: var(--orange); color: #111; font-weight: 800; }
.claim-row { display: flex; gap: 8px; }
.claim-row input { flex: 1; min-width: 0; min-height: 50px; padding: 0 14px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, 0.25); background: rgba(0, 0, 0, 0.35); color: #fff; font: inherit; font-size: 17px; }
.claim-row input:focus { outline: none; border-color: var(--orange); }
.claim-row .btn { min-height: 50px; white-space: nowrap; width: auto; flex: 0 0 auto; padding-inline: 18px; margin: 0; }
.claim-row input { flex: 1 1 auto; }
.claim-err { min-height: 1.2em; margin: 8px 0 0; color: #ff8a7a; font-size: 14px; font-weight: 600; }
@media (max-width: 420px) { .claim-row { flex-direction: column; } .claim-row .btn { width: 100%; } }
