:root {
  color-scheme: dark;
  --bg: #080b1c;
  --surface: rgba(19, 24, 51, .78);
  --surface-strong: #151a35;
  --line: rgba(171, 183, 255, .13);
  --muted: #929bbd;
  --text: #f6f7ff;
  --cyan: #64eaff;
  --violet: #8c6bff;
  --pink: #ff5db8;
  --gold: #ffd36b;
  --green: #77f2bd;
  font-family: "Tajawal", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; color: var(--text); min-height: 100vh; background:
  radial-gradient(ellipse at 85% -12%, rgba(64, 78, 206, .25), transparent 38rem),
  radial-gradient(ellipse at -10% 50%, rgba(74, 33, 149, .18), transparent 34rem), var(--bg); }
button, input { font: inherit; }
button { color: inherit; }
.ambient { position: fixed; z-index: -1; pointer-events: none; filter: blur(90px); opacity: .18; border-radius: 50%; }
.ambient-one { width: 210px; height: 210px; background: #3a62ff; top: 22%; right: -130px; }
.ambient-two { width: 180px; height: 180px; background: #c23bde; bottom: 10%; left: -120px; }
.app-shell { width: min(100%, 760px); margin: auto; padding: max(16px, env(safe-area-inset-top)) 18px calc(96px + env(safe-area-inset-bottom)); }
.topbar { height: 50px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; color: #081022; font-weight: 900; font-size: 21px; background: linear-gradient(145deg, var(--cyan), #a1a0ff 75%); box-shadow: 0 5px 24px #675cff44; }
.brand strong { display: block; font-size: 15px; font-weight: 900; letter-spacing: 1.8px; line-height: 1; }
.brand small { display: block; margin-top: 4px; color: #858eb2; font: 700 7px/1 system-ui, sans-serif; letter-spacing: 1.2px; }
.topbar-pills { display: flex; gap: 7px; }
.currency-pill { display: flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 30px; background: #11162bbf; font-size: 13px; }
.currency-pill span { font-size: 14px; }
.coin-pill { color: #ffe38e; }
.welcome-row { display: flex; align-items: center; gap: 12px; padding: 20px 2px 17px; }
.avatar { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; border: 2px solid #77eaff; background: linear-gradient(150deg, #263d76, #372868); box-shadow: 0 0 18px #47dbff3b; font-size: 23px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.welcome-copy { min-width: 0; flex: 1; }
.eyebrow { margin: 0 0 4px; color: var(--cyan); font-size: 11px; font-weight: 700; letter-spacing: .2px; }
.welcome-copy h1 { margin: 0; font-size: 20px; font-weight: 800; }
.welcome-copy h1 span { color: #cbd1ff; }
.handle { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.level-badge { display: flex; align-items: center; gap: 5px; padding: 7px 10px; color: var(--gold); border: 1px solid #ffd36b33; border-radius: 14px; background: #32251472; }
.level-badge span { font: 800 9px system-ui; letter-spacing: .5px; }
.level-badge b { font-size: 16px; }
.notice { margin: 4px 0 15px; padding: 12px 14px; border: 1px solid #ffd36b2b; border-radius: 14px; background: #32251466; color: #ffe7ac; font-size: 13px; line-height: 1.5; }
.hidden { display: none !important; }
.toast { position: fixed; z-index: 1200; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -18px); opacity: 0; pointer-events: none; width: min(92vw, 420px); padding: 12px 16px; text-align: center; border: 1px solid #8797ff45; border-radius: 15px; background: #171d3a; box-shadow: 0 12px 40px #0008; font-size: 14px; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.challenge-panel { position: relative; overflow: hidden; margin-bottom: 17px; padding: 16px; border: 1px solid #9f80ff55; border-radius: 20px; background: linear-gradient(112deg, #27205f, #182445 70%, #192c47); }
.challenge-panel h3 { margin: 4px 0; font-size: 17px; }
.challenge-panel p { margin: 0 0 10px; color: #c1c8e9; font-size: 12px; }
.challenge-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.challenge-player { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 9px 10px; border: 1px solid #ffffff0c; border-radius: 12px; background: #080d22aa; font-size: 12px; }
.challenge-player span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.challenge-player b { display: block; color: var(--gold); font-size: 15px; }
.challenge-player-pending { min-height: 54px; border-style: dashed; color: #b6c0d8; background: #ffffff08; }
.challenge-panel .primary-button { position: relative; z-index: 1; min-height: 38px; }
.page { display: none; animation: rise .25s ease; }
.page.active { display: block; }
@keyframes rise { from { opacity: .4; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.hero-card { position: relative; display: flex; min-height: 230px; overflow: hidden; padding: 24px 23px; border: 1px solid #b2bdff22; border-radius: 25px; background: linear-gradient(112deg, #20245d 0%, #272465 47%, #302264 100%); box-shadow: inset 0 1px 0 #ffffff12, 0 16px 50px #06091a55; }
.hero-copy { position: relative; z-index: 2; max-width: 62%; }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; color: #c7d5ff; font-size: 11px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.hero-copy h2 { margin: 18px 0 7px; font-size: clamp(24px, 6vw, 31px); font-weight: 900; line-height: 1.14; }
.hero-copy h2 em { color: var(--cyan); font-style: normal; }
.hero-copy p { margin: 0 0 16px; max-width: 240px; color: #c2c6e7; font-size: 12px; line-height: 1.65; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 11px; min-height: 40px; padding: 0 15px; border: 0; border-radius: 12px; color: #08111d; background: linear-gradient(105deg, #89f0ff, #84c8ff); font-weight: 900; font-size: 13px; box-shadow: 0 5px 20px #65d7ff24; cursor: pointer; }
.primary-button:active { transform: scale(.97); }
.hero-art { position: absolute; inset: 0 47% 0 0; display: grid; place-items: center; opacity: .95; }
.orb { position: absolute; border-radius: 50%; }
.orb-large { width: 115px; height: 115px; background: radial-gradient(circle at 35% 28%, #f4ffff, #68eaff 34%, #6164ff 67%, #3539a7); box-shadow: 0 0 28px #5be8ff88, 0 0 75px #675dff77; }
.orb-small { width: 31px; height: 31px; top: 38px; right: 22px; background: radial-gradient(circle at 30% 25%, #ffeeb0, #ffba56 65%, #ef6781); box-shadow: 0 0 20px #ffb85a88; }
.hero-star { position: absolute; top: 36px; left: 18px; color: #fc6cff; text-shadow: 0 0 15px #fb73ff; font-size: 30px; }
.hero-cube { position: absolute; bottom: 25px; right: 25px; color: #70ffcf; filter: drop-shadow(0 0 10px #32ffb6); font-size: 38px; transform: rotate(15deg); }
.hero-ring { position: absolute; width: 160px; height: 160px; border: 1px solid #c6d8ff24; border-radius: 50%; }
.ring-one { top: -74px; left: 34%; }
.ring-two { bottom: -120px; left: 5%; width: 230px; height: 230px; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 13px 0 25px; }
.stat-card { position: relative; display: flex; flex-direction: column; min-height: 91px; padding: 12px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(150deg, #151a34e8, #10142bdf); }
.stat-icon { position: absolute; top: 10px; left: 11px; font-size: 15px; opacity: .9; }
.stat-label { color: var(--muted); font-size: 10px; font-weight: 600; }
.stat-card b { margin-top: 8px; font-size: 21px; font-weight: 900; }
.section-block { margin: 0 0 25px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-heading h2, .page-heading h2 { margin: 0; font-size: 20px; font-weight: 900; }
.section-tag { padding: 5px 9px; color: #abb4d7; border: 1px solid var(--line); border-radius: 20px; font-size: 10px; white-space: nowrap; }
.text-button { padding: 4px 0; border: 0; color: var(--cyan); background: none; font-size: 12px; font-weight: 700; cursor: pointer; }
.mission-list { display: grid; gap: 8px; }
.mission-card { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 16px; background: #12172fbd; }
.mission-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 13px; background: #27234d; font-size: 18px; }
.mission-main { flex: 1; min-width: 0; }
.mission-main b { display: block; font-size: 13px; }
.mission-main small { display: block; margin: 1px 0 6px; color: var(--muted); font-size: 10px; }
.mission-count { color: var(--cyan); font-size: 11px; font-weight: 800; white-space: nowrap; }
.progress-track { height: 5px; overflow: hidden; border-radius: 9px; background: #ffffff12; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #69e6ff, #9972ff); transition: width .3s; }
.featured-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini-game { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #141a36; cursor: pointer; }
.mini-game img { display: block; width: 100%; height: 105px; object-fit: cover; background: #20264b; }
.mini-game .mini-game-title { display: block; padding: 9px 10px 11px; overflow: hidden; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.mini-game::after { position: absolute; top: 7px; right: 7px; padding: 4px 7px; border-radius: 8px; background: #090d20c9; content: "▶"; font-size: 9px; }
.level-progress-card { padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(150deg, #171d3c, #11152c); }
.level-progress-top { display: flex; justify-content: space-between; margin-bottom: 9px; color: #c4cbe6; font-size: 11px; }
.level-progress-top b { color: var(--text); }
.level-track { height: 7px; }
.map-track { display: flex; align-items: center; justify-content: space-between; margin: 19px 0 12px; }
.map-track > i { flex: 1; height: 2px; background: linear-gradient(90deg, #66dff7, #ffffff22); }
.map-node { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border: 1px solid #ffffff22; border-radius: 50%; background: #1b2040; font-size: 15px; }
.map-node.completed { border-color: #64eaff88; background: #163d4c; }
.map-node.current { border-color: #a88aff; box-shadow: 0 0 16px #956dff55; }
.level-progress-card > p { margin: 0; color: var(--muted); font-size: 10px; }
.page-heading { padding: 19px 0 13px; }
.page-heading h2 { font-size: 25px; }
.page-heading > p:last-child { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.search-box { display: flex; align-items: center; gap: 9px; height: 45px; padding: 0 13px; border: 1px solid var(--line); border-radius: 14px; background: #11162f; color: #8e9abc; }
.search-box span { font-size: 25px; line-height: 1; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 13px; }
.search-box input::placeholder { color: #818aa8; }
.filter-row { display: flex; gap: 7px; overflow-x: auto; padding: 12px 0 14px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; padding: 7px 12px; border: 1px solid var(--line); border-radius: 22px; color: #bac2df; background: #141932; font-size: 11px; font-weight: 700; cursor: pointer; }
.filter-chip.active { border-color: #68dcf777; color: #07121e; background: linear-gradient(100deg, #77edff, #8bc9ff); }
.games-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.game-card { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #131832; }
.game-image { position: relative; }
.game-image img { display: block; width: 100%; height: 110px; object-fit: cover; background: #22294b; }
.game-image .game-category { position: absolute; right: 7px; bottom: 7px; padding: 4px 7px; border: 1px solid #ffffff16; border-radius: 8px; background: #080c1cce; color: #dbe4ff; font-size: 9px; }
.game-card-body { padding: 9px; }
.game-card h3 { min-height: 34px; margin: 0 0 8px; font-size: 12px; font-weight: 800; line-height: 1.4; }
.game-actions { display: grid; grid-template-columns: 1fr 34px; gap: 6px; }
.play-card-button { min-height: 34px; border: 0; border-radius: 10px; color: #07121e; background: linear-gradient(105deg, #85ecff, #93bcff); font-size: 11px; font-weight: 900; cursor: pointer; }
.challenge-card-button { border: 1px solid #9981ff55; border-radius: 10px; color: #d6ccff; background: #282252; font-size: 15px; cursor: pointer; }
.catalog-note { margin: 14px 0; color: #7883a6; text-align: center; font-size: 10px; }
.empty-state { grid-column: 1 / -1; padding: 25px 14px; border: 1px dashed #ffffff25; border-radius: 15px; color: var(--muted); text-align: center; font-size: 13px; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 7px 0 14px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: #10152d; }
.segmented-control button { min-height: 34px; border: 0; border-radius: 10px; color: #aeb8da; background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.segmented-control button.active { color: #07121e; background: linear-gradient(100deg, #81e9ff, #a8b4ff); }
.leaderboard-list { display: grid; gap: 7px; }
.leader-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 15px; background: #131832; }
.leader-rank { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 11px; color: #b6c0e3; background: #242b4b; font-size: 12px; font-weight: 900; }
.leader-row:nth-child(1) .leader-rank { color: #271600; background: linear-gradient(145deg, #ffe993, #e7a732); }
.leader-row:nth-child(2) .leader-rank { color: #101321; background: #c7d1e5; }
.leader-row:nth-child(3) .leader-rank { color: #311c0d; background: #ce9871; }
.leader-name { flex: 1; overflow: hidden; font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.leader-score { color: var(--cyan); font-size: 13px; font-weight: 900; }
.season-card { padding: 17px; border: 1px solid #a48bff35; border-radius: 21px; background: linear-gradient(145deg, #24205a, #171b3a 68%, #182743); }
.season-title { display: flex; align-items: center; gap: 10px; }
.season-emblem { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 15px; color: #fff0af; background: linear-gradient(145deg, #935dff, #4036a5); font-size: 22px; }
.season-title div { flex: 1; }
.season-title small, .season-title b { display: block; }
.season-title small { color: #abb4da; font-size: 10px; }
.season-title b { margin-top: 2px; font-size: 16px; }
.season-level { padding: 6px 9px; border: 1px solid #ffffff21; border-radius: 11px; color: #d5ccff; font-size: 10px; }
.season-route { position: relative; display: flex; justify-content: space-between; margin: 35px 3px 30px; }
.route-line { position: absolute; top: 18px; right: 12%; left: 12%; height: 3px; border-radius: 5px; background: linear-gradient(90deg, #69eaff, #9470ff44 75%); }
.route-stop { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; color: #a7b0d2; font-size: 10px; }
.route-stop > span { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #ffffff24; border-radius: 50%; background: #20264a; font-size: 16px; }
.route-stop.stop-done > span { border-color: #66eaff; background: #16505d; }
.route-stop.stop-current > span { border-color: #b39bff; box-shadow: 0 0 18px #a779ff63; }
.season-xp { display: flex; justify-content: space-between; padding-top: 12px; border-top: 1px solid #ffffff17; color: #b7c0e0; font-size: 11px; }
.season-xp b { color: var(--cyan); }
.info-card { display: flex; gap: 10px; margin-top: 12px; padding: 13px; border: 1px solid #67dfff29; border-radius: 14px; color: #b9c8e9; background: #112239a8; font-size: 12px; line-height: 1.5; }
.info-card p { margin: 0; }
.wallet-card { display: flex; align-items: center; gap: 12px; padding: 17px; border: 1px solid #ffd36b38; border-radius: 19px; background: linear-gradient(115deg, #372b22, #201d2b 75%); }
.wallet-coin { font-size: 30px; }
.wallet-card div { flex: 1; }
.wallet-card small, .wallet-card b { display: block; }
.wallet-card small { color: #c4b393; font-size: 11px; }
.wallet-card b { margin-top: 2px; color: #ffe09a; font-size: 22px; }
.wallet-caption { color: #b9aa91; font-size: 9px; }
.reward-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 13px; }
.reward-card { display: flex; flex-direction: column; min-height: 130px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #131832; }
.reward-card > span { font-size: 22px; }
.reward-card b { margin-top: 7px; font-size: 13px; }
.reward-card small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.reward-card em { margin-top: auto; padding-top: 9px; color: #8e9aba; font-size: 10px; font-style: normal; }
.reward-card.unlocked { border-color: #75e8bd4b; background: linear-gradient(150deg, #153b39, #151b33); }
.reward-card.unlocked em { color: var(--green); }
.bottom-nav { position: fixed; z-index: 100; right: 50%; bottom: max(9px, env(safe-area-inset-bottom)); display: flex; justify-content: space-around; width: min(calc(100% - 22px), 720px); min-height: 67px; padding: 7px 5px; transform: translateX(50%); border: 1px solid #b1c0ff1c; border-radius: 23px; background: #0d1229ed; box-shadow: 0 12px 36px #0008; backdrop-filter: blur(18px); }
.nav-item { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 15px; color: #909bbc; background: transparent; cursor: pointer; }
.nav-item > span { font-size: 19px; line-height: 1; }
.nav-item small { font-size: 9px; font-weight: 700; }
.nav-item.active { color: var(--cyan); background: #1c2942; }
.nav-item.active > span { filter: drop-shadow(0 0 7px #68dfff80); }
.modal { position: fixed; z-index: 500; inset: 0; display: none; flex-direction: column; padding-top: env(safe-area-inset-top); background: #03040a; }
.modal.open { display: flex; }
.modal-header { display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 7px 12px; border-bottom: 1px solid #ffffff1a; background: #0d1122; }
.modal-game-title { flex: 1; text-align: center; }
.modal-game-title small, .modal-game-title b { display: block; }
.modal-game-title small { color: var(--muted); font-size: 9px; }
.modal-game-title b { font-size: 14px; }
.icon-button { display: grid; place-items: center; flex: 0 0 37px; width: 37px; height: 37px; border: 1px solid #ffffff19; border-radius: 12px; color: #e8ecff; background: #1a2037; font-size: 22px; cursor: pointer; }
.iframe-wrap { position: relative; flex: 1; min-height: 0; background: #000; }
.iframe-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.score-form { padding: 11px 13px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid #ffffff18; background: #11162a; }
.score-form label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.score-entry { display: flex; gap: 7px; }
.score-entry input { min-width: 0; flex: 1; padding: 0 12px; border: 1px solid #ffffff20; border-radius: 11px; outline: 0; color: #fff; background: #080c19; }
.score-entry input:focus { border-color: #68eaff88; }
.score-entry .primary-button { min-height: 42px; }
.score-form > small { display: block; margin-top: 5px; color: #99a2be; font-size: 9px; }
@media (min-width: 600px) {
  .app-shell { padding-right: 26px; padding-left: 26px; }
  .hero-card { min-height: 258px; padding: 32px; }
  .hero-art { inset-inline-start: 0; }
  .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .featured-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .game-image img { height: 132px; }
}
@media (max-width: 360px) {
  .app-shell { padding-right: 12px; padding-left: 12px; }
  .hero-card { padding: 19px 16px; }
  .hero-art { inset-inline-start: -14px; }
  .game-image img { height: 93px; }
  .stat-card { padding: 10px 8px; }
}

/* Polished, mobile-first arena skin inspired by arcade game launchers. */
:root {
  color-scheme: dark;
  --bg: #090a14;
  --surface: rgba(24, 25, 44, .82);
  --surface-strong: #191a30;
  --line: rgba(192, 194, 255, .14);
  --muted: #a1a2b9;
  --text: #fbfaff;
  --cyan: #73f2e0;
  --violet: #9d7cff;
  --pink: #ff66bb;
  --gold: #ffd878;
}

html { background: var(--bg); }
body {
  background:
    radial-gradient(ellipse at 82% -8%, rgba(129, 73, 255, .28), transparent 34rem),
    radial-gradient(ellipse at 0% 38%, rgba(34, 208, 198, .11), transparent 28rem),
    radial-gradient(ellipse at 95% 68%, rgba(255, 70, 162, .10), transparent 28rem),
    var(--bg);
}
.app-shell { width: min(100%, 900px); }
.topbar {
  position: sticky;
  top: max(0px, env(safe-area-inset-top));
  z-index: 40;
  margin: 0 -7px;
  padding: 5px 7px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(9, 10, 20, .72);
  backdrop-filter: blur(18px);
}
.brand-mark {
  border-radius: 13px;
  color: #11101a;
  background: linear-gradient(145deg, #9cfff2, #90a4ff 68%, #d28dff);
  box-shadow: 0 5px 25px #9c7aff44;
}
.brand strong { letter-spacing: .3px; font-size: 16px; }
.brand small { color: #aaa8c4; letter-spacing: 1.05px; }
.welcome-row { padding-top: 22px; }
.avatar { border-color: #9b8aff; box-shadow: 0 0 22px #8d6cff45; }
.hero-card {
  min-height: 270px;
  border-color: rgba(198, 153, 255, .3);
  background:
    linear-gradient(105deg, rgba(17, 18, 39, .96) 5%, rgba(37, 26, 78, .78) 56%, rgba(31, 27, 73, .7)),
    radial-gradient(circle at 76% 50%, #9e55ff 0, #3d286e 30%, #181a36 74%);
  box-shadow: inset 0 1px 0 #ffffff1c, 0 20px 60px #0007;
}
.hero-card::after {
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #8c7dff99, #70f2e0aa, transparent);
  content: "";
}
.hero-copy h2 { font-size: clamp(27px, 7vw, 37px); }
.hero-copy h2 em { color: #8ff7e7; }
.primary-button {
  color: #11101a;
  background: linear-gradient(105deg, #91fff0, #a1b3ff 65%, #d3a3ff);
  box-shadow: 0 7px 26px #8d6eff36;
}
.orb-large {
  width: 142px;
  height: 142px;
  background: radial-gradient(circle at 35% 28%, #fff, #87f8e6 31%, #8a73ff 67%, #5927a8);
  box-shadow: 0 0 35px #8d7cff99, 0 0 100px #7d45ff70;
}
.orb-small { background: radial-gradient(circle at 30% 25%, #fff2b8, #ff9d5b 65%, #ff5f9c); }
.hero-star { color: #ff91df; }
.hero-cube { color: #8ffff0; }
.stat-card, .mission-card, .level-progress-card, .mini-game,
.game-card, .leader-row, .reward-card {
  border-color: rgba(192,194,255,.12);
  background: linear-gradient(145deg, rgba(28,29,51,.92), rgba(17,18,34,.92));
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.stat-card { min-height: 100px; }
.stat-card b { color: #fff; }
.section-heading h2, .page-heading h2 { letter-spacing: -.25px; }
.mini-game, .game-card { transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.mini-game:hover, .game-card:hover {
  transform: translateY(-3px);
  border-color: rgba(143,247,231,.48);
  box-shadow: 0 14px 32px rgba(0,0,0,.28);
}
.mini-game img { height: 128px; }
.game-image img { height: 140px; }
.game-card { border-radius: 19px; }
.game-card-body { padding: 11px; }
.game-card h3 { font-size: 13px; }
.play-card-button {
  border-radius: 11px;
  background: linear-gradient(110deg, #92fff0, #a2b0ff);
  box-shadow: 0 5px 18px #78e9df1f;
}
.challenge-card-button {
  border-color: #a784ff55;
  color: #e3d5ff;
  background: linear-gradient(145deg,#312551,#211e3e);
}
.filter-chip { background: rgba(21,23,42,.9); }
.filter-chip.active, .segmented-control button.active {
  color: #11101a;
  background: linear-gradient(100deg, #8ff8e7, #aab0ff);
}
.leaderboard-game-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 13px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: #c8c8dd;
  background: rgba(20,21,40,.86);
  font-size: 12px;
  font-weight: 800;
}
.leaderboard-game-picker select {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(183,173,255,.2);
  border-radius: 10px;
  outline: none;
  color: #fbfaff;
  background: #211f3a;
  font: inherit;
}
.leaderboard-game-picker select:focus { border-color: var(--cyan); }
.leader-row { border-radius: 16px; }
.leader-row:nth-child(1) { border-color: #ffd87855; background: linear-gradient(100deg,#332a2d,#1c1c31); }
.leader-score { color: var(--cyan); }
.bottom-nav {
  border-color: rgba(190,190,255,.18);
  background: rgba(14,15,31,.9);
  box-shadow: 0 12px 42px #0009;
}
.nav-item.active {
  color: #9efff0;
  background: linear-gradient(140deg, rgba(65,71,122,.56), rgba(55,43,94,.6));
}
.challenge-panel {
  border-color: rgba(160,131,255,.45);
  background: linear-gradient(112deg, rgba(50,37,91,.96), rgba(23,37,66,.96) 72%, rgba(30,50,69,.96));
}
@media (min-width: 600px) {
  .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .featured-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 820px) {
  .games-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .game-image img { height: 150px; }
  .app-shell { padding-right: 34px; padding-left: 34px; }
}

/* ---------- نافذة اختيار طريقة اللعب ---------- */
.sheet-backdrop { position: fixed; z-index: 450; inset: 0; display: flex; align-items: flex-end; justify-content: center; background: #02030acc; backdrop-filter: blur(4px); animation: sheetFade .2s ease-out; }
.sheet { position: relative; width: min(100%, 460px); max-height: 92vh; overflow-y: auto; padding: 20px 16px calc(18px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; background: linear-gradient(180deg, #1b2145, #121733); box-shadow: 0 -18px 60px #000a; animation: sheetUp .28s cubic-bezier(.2, .9, .3, 1); }
.sheet-close { position: absolute; top: 12px; left: 12px; width: 32px; height: 32px; border: 1px solid #ffffff19; border-radius: 10px; color: #e8ecff; background: #1a2037; font-size: 20px; line-height: 1; cursor: pointer; }
.sheet-head { padding: 0 40px 12px; text-align: center; }
.sheet-head small { display: block; color: var(--muted); font-size: 11px; }
.sheet-head h3 { margin: 3px 0 0; font-size: 19px; }
.sheet-options { display: grid; gap: 10px; }
.choice-option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: right; border: 1px solid var(--line); border-radius: 16px; color: var(--text); background: #ffffff0d; cursor: pointer; transition: transform .12s, border-color .12s, background .12s; }
.choice-option:hover { border-color: #64eaff66; background: #64eaff14; }
.choice-option:active { transform: scale(.98); }
.choice-icon { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(135deg, #3a4aa8, #7b5cff); font-size: 22px; }
.choice-option[data-choice="friend"] .choice-icon { background: linear-gradient(135deg, #7b5cff, #ff5db8); }
.choice-option[data-choice="group"] .choice-icon { background: linear-gradient(135deg, #14a7c8, #77f2bd); }
.choice-text { display: grid; gap: 2px; }
.choice-text b { font-size: 15px; }
.choice-text small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.sheet-note { margin: 0 0 4px; padding: 10px 12px; border: 1px solid #ffd36b2b; border-radius: 14px; background: #32251466; color: #ffe7ac; font-size: 12.5px; line-height: 1.7; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
@keyframes sheetFade { from { opacity: 0; } }
.challenge-panel .send-challenge { margin-inline-start: 8px; color: var(--text); background: linear-gradient(135deg, #7b5cff, #ff5db8); }

/* ---------- calmer, coordinated arena palette ---------- */
:root {
  --bg: #0a1420;
  --surface: rgba(18, 34, 49, .9);
  --surface-strong: #152638;
  --line: rgba(172, 213, 227, .15);
  --muted: #a4b6c7;
  --text: #f3f8fc;
  --cyan: #78dfd4;
  --violet: #a18df3;
  --pink: #f18db4;
  --gold: #f4cf79;
  --green: #75d7a9;
}

html {
  background: var(--bg);
}

body {
  background:
    radial-gradient(ellipse at 88% -10%, rgba(80, 147, 177, .22), transparent 37rem),
    radial-gradient(ellipse at 4% 48%, rgba(117, 92, 167, .15), transparent 34rem),
    linear-gradient(180deg, #0b1724, #0a1420 68%);
}

.brand-mark {
  color: #071923;
  background: linear-gradient(145deg, #9aeee0, #79c7df 58%, #aa9af2);
  box-shadow: 0 5px 22px rgba(104, 210, 215, .24);
}

.currency-pill,
.search-box,
.filter-chip,
.mini-game,
.game-card,
.stat-card,
.mission-card,
.leader-row,
.level-progress-card,
.reward-card {
  border-color: rgba(172, 213, 227, .16);
  background-color: rgba(18, 34, 49, .88);
}

.hero-card {
  border-color: rgba(172, 213, 227, .2);
  background:
    radial-gradient(circle at 88% 20%, rgba(125, 205, 205, .16), transparent 13rem),
    linear-gradient(112deg, #173b50 0%, #253a61 52%, #3a315e 100%);
  box-shadow: inset 0 1px 0 #ffffff18, 0 16px 50px #060d1555;
}

.hero-copy h2 em,
.text-button,
.leader-score {
  color: var(--cyan);
}

.primary-button,
.play-card-button {
  color: #09212a;
  background: linear-gradient(105deg, #91eadb, #93d9e6 55%, #b6b2f5);
  box-shadow: 0 5px 18px rgba(91, 192, 192, .2);
}

.bottom-nav {
  border-color: rgba(172, 213, 227, .2);
  background: rgba(10, 23, 37, .94);
  box-shadow: 0 12px 36px rgba(0, 6, 16, .58);
}

.nav-item.active {
  color: #9be9de;
  background: rgba(88, 163, 171, .16);
}

.nav-item.active > span {
  filter: drop-shadow(0 0 7px rgba(120, 223, 212, .56));
}

.modal-header {
  background: #101c2a;
}

.icon-button,
.sheet-close {
  border-color: rgba(172, 213, 227, .16);
  background: #1a2b3d;
}

.sheet {
  border-color: rgba(172, 213, 227, .2);
  background: linear-gradient(180deg, #1a2b42, #111e30);
}

.choice-option:hover,
.choice-option:focus-visible {
  border-color: rgba(120, 223, 212, .6);
  background: rgba(120, 223, 212, .09);
  outline: none;
}

.choice-icon {
  background: linear-gradient(135deg, #356f82, #6e6db2);
}

.choice-option[data-choice="friend"] .choice-icon {
  background: linear-gradient(135deg, #7659a7, #be668c);
}

.choice-option[data-choice="group"] .choice-icon {
  background: linear-gradient(135deg, #30899a, #5fb99a);
}

.match-result-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 17, .82);
  backdrop-filter: blur(14px);
}

.match-result-backdrop.hidden {
  display: none;
}

.match-result-card {
  position: relative;
  width: min(100%, 460px);
  padding: 27px 22px 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 28px;
  color: #f4f7ff;
  text-align: center;
  background:
    radial-gradient(circle at 50% -14%, rgba(120, 223, 212, .2), transparent 15rem),
    linear-gradient(155deg, #151d36, #0a1020 72%);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
  animation: match-card-in .22s ease-out both;
}

@keyframes match-card-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.match-result-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 50%;
  color: #cbd2e7;
  font-size: 24px;
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
}

.match-game-pill {
  display: inline-flex;
  max-width: calc(100% - 48px);
  padding: 7px 13px;
  overflow: hidden;
  border: 1px solid rgba(157, 171, 255, .23);
  border-radius: 999px;
  color: #dfe5ff;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(120, 127, 215, .15);
}

.match-result-card h2 {
  margin: 16px 0 5px;
  font-size: clamp(24px, 7vw, 31px);
  letter-spacing: -.04em;
}

.match-result-intro {
  margin: 0 auto;
  max-width: 330px;
  color: #aeb8ce;
  font-size: 13px;
  line-height: 1.75;
}

.match-versus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  margin: 26px 0 16px;
}

.match-player {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.match-avatar {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 3px solid #f5c94f;
  border-radius: 50%;
  color: #172033;
  font-size: 28px;
  background: linear-gradient(145deg, #fff1a5, #ffb638);
  box-shadow: 0 0 0 5px rgba(247, 195, 53, .12), 0 10px 26px rgba(0, 0, 0, .3);
}

.match-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.match-player > span {
  max-width: 100%;
  overflow: hidden;
  color: #e6e9f4;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-player > b {
  color: #fff;
  font-size: 19px;
  line-height: 1.15;
}

.match-player > small {
  color: #aab3c7;
  font-size: 11px;
}

.match-vs {
  color: #f7d46d;
  font-size: 15px;
  font-weight: 950;
  text-shadow: 0 2px 14px rgba(247, 212, 109, .35);
}

.match-player-waiting .match-avatar {
  border-color: rgba(255, 255, 255, .19);
  color: #9ca6bb;
  background: linear-gradient(145deg, #434b5b, #242b3a);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .12);
}

.match-player-waiting .match-avatar-waiting {
  font-size: 36px;
}

.match-player-waiting > b {
  color: #b7c0d2;
  font-size: 14px;
}

.match-status {
  min-height: 22px;
  margin: 0 0 15px;
  color: #b9c6dd;
  font-size: 12px;
  line-height: 1.7;
}

.match-share-button,
.match-later-button {
  width: 100%;
  min-height: 49px;
  border-radius: 15px;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}

.match-share-button {
  border: 0;
  color: #101729;
  background: linear-gradient(105deg, #f6d75d, #f5a84c 55%, #ff8a6a);
  box-shadow: 0 8px 24px rgba(245, 168, 76, .2);
}

.match-share-button:disabled {
  opacity: .68;
  cursor: wait;
}

.match-later-button {
  min-height: 42px;
  margin-top: 7px;
  border: 1px solid rgba(255, 255, 255, .1);
  color: #d1d8e8;
  background: rgba(255, 255, 255, .045);
}

.match-result-footnote {
  display: block;
  margin-top: 13px;
  color: #7f8aa1;
  font-size: 10px;
  line-height: 1.6;
}

@media (max-width: 380px) {
  .match-result-card { padding: 24px 16px 17px; }
  .match-avatar { width: 72px; height: 72px; }
}

/* AL-Ameen Arena identity: midnight blue, championship gold, geometric arena mark. */
:root {
  --bg: #091426;
  --surface: rgba(17, 30, 53, .88);
  --surface-strong: #14213a;
  --line: rgba(145, 177, 235, .16);
  --muted: #a6b3ca;
  --text: #f8faff;
  --cyan: #79aaff;
  --violet: #527de2;
  --pink: #f0bd57;
  --gold: #f7ce68;
  --green: #80d6b2;
}
html { background: var(--bg); }
body {
  background:
    radial-gradient(ellipse at 82% -8%, rgba(57, 105, 204, .27), transparent 34rem),
    radial-gradient(ellipse at 0% 38%, rgba(236, 181, 73, .10), transparent 27rem),
    radial-gradient(ellipse at 96% 72%, rgba(36, 82, 167, .13), transparent 28rem),
    var(--bg);
}
.ambient-one { background: #4c7fe4; }
.ambient-two { background: #e7ad47; }
.topbar {
  background: rgba(9, 20, 38, .78);
  border-bottom-color: rgba(161, 188, 235, .11);
}
.brand-mark {
  border: 1px solid rgba(255, 223, 146, .62);
  border-radius: 13px;
  background: linear-gradient(145deg, #f8d77b, #e8ad44);
  box-shadow: 0 5px 24px rgba(235, 181, 68, .28);
}
.brand-mark img { display: block; width: 30px; height: 30px; }
.brand strong { color: #fffaf0; }
.brand small { color: #aab8d2; }
.avatar { border-color: #e8ba55; box-shadow: 0 0 19px rgba(238, 191, 81, .25); }
.level-badge {
  color: #f8d777;
  border-color: rgba(247, 206, 104, .35);
  background: rgba(94, 68, 26, .26);
}
.hero-card {
  border-color: rgba(127, 164, 231, .35);
  background:
    linear-gradient(105deg, rgba(10, 23, 47, .98) 5%, rgba(24, 45, 84, .9) 58%, rgba(35, 50, 87, .78)),
    radial-gradient(circle at 76% 50%, #d8a844 0, #3864bc 29%, #142344 73%);
  box-shadow: inset 0 1px 0 #ffffff1a, 0 20px 60px rgba(1, 8, 21, .58);
}
.hero-card::after {
  background: linear-gradient(90deg, transparent, #4f82e9aa, #f4cf71, transparent);
}
.hero-copy h2 em { color: #f7d476; }
.hero-kicker { color: #c5d7fa; }
.primary-button,
.play-card-button {
  color: #17233c;
  background: linear-gradient(105deg, #f9d979, #eeb748);
  box-shadow: 0 7px 25px rgba(230, 177, 66, .25);
}
.hero-art { opacity: .9; }
.orb-large {
  border: 1px solid rgba(255, 226, 153, .62);
  background: radial-gradient(circle at 35% 28%, #fff9df, #8ab7ff 29%, #3d70d1 62%, #1a3672);
  box-shadow: 0 0 34px rgba(89, 139, 235, .78), 0 0 84px rgba(57, 103, 203, .55);
}
.orb-small {
  background: radial-gradient(circle at 30% 25%, #fff7d5, #f5cd68 62%, #d99935);
  box-shadow: 0 0 22px rgba(247, 206, 104, .58);
}
.hero-star { color: #ffdf8a; text-shadow: 0 0 15px rgba(251, 207, 105, .8); }
.hero-cube { color: #91baff; filter: drop-shadow(0 0 10px rgba(89, 139, 235, .72)); }
.stat-card,
.mission-card,
.level-progress-card,
.mini-game,
.game-card,
.leader-row,
.reward-card {
  border-color: rgba(143, 174, 226, .15);
  background: linear-gradient(145deg, rgba(22, 37, 64, .96), rgba(14, 27, 49, .96));
}
.stat-icon { filter: saturate(.8); }
.mission-icon { background: linear-gradient(145deg, #253d66, #312c48); }
.progress-track i { background: linear-gradient(90deg, #5d8fe9, #f2c760); }
.mini-game:hover,
.game-card:hover {
  border-color: rgba(247, 206, 104, .48);
  box-shadow: 0 14px 32px rgba(1, 8, 21, .42);
}
.game-image .game-category,
.mini-game::after { background: rgba(7, 16, 32, .86); }
.game-image .game-category { border-color: rgba(240, 204, 119, .22); }
.challenge-card-button {
  border-color: rgba(120, 160, 235, .36);
  color: #dbe6ff;
  background: linear-gradient(145deg, #243e70, #1a2b4b);
}
.filter-chip.active,
.segmented-control button.active {
  color: #16223a;
  background: linear-gradient(100deg, #f8d879, #eab44e);
}
.leaderboard-game-picker {
  color: #d6e2fa;
  background: rgba(18, 33, 58, .94);
}
.leaderboard-game-picker select {
  border-color: rgba(126, 163, 230, .26);
  color: #f7f9ff;
  background: #172a4a;
}
.leaderboard-game-picker select:focus { border-color: var(--gold); }
.leader-row:nth-child(1) {
  border-color: rgba(247, 206, 104, .42);
  background: linear-gradient(100deg, rgba(93, 68, 29, .62), rgba(22, 37, 64, .96));
}
.leader-score { color: #8db6ff; }
.leader-row:nth-child(1) .leader-score { color: #ffdc7e; }
.bottom-nav {
  border-color: rgba(142, 175, 232, .2);
  background: rgba(9, 20, 38, .94);
}
.nav-item.active {
  color: #f7d273;
  background: linear-gradient(140deg, rgba(53, 85, 145, .48), rgba(105, 79, 39, .3));
}
.nav-item.active > span { filter: drop-shadow(0 0 7px rgba(247, 206, 104, .52)); }
.challenge-panel {
  border-color: rgba(247, 206, 104, .36);
  background: linear-gradient(112deg, rgba(31, 49, 87, .98), rgba(19, 37, 68, .98) 72%, rgba(47, 45, 62, .98));
}
.challenge-panel .send-challenge {
  color: #f8faff;
  background: linear-gradient(135deg, #416ec0, #263f70);
}
.season-card {
  border-color: rgba(247, 206, 104, .3);
  background: linear-gradient(145deg, #1c3766, #152642 68%, #302d3c);
}
.season-emblem { color: #ffdf8a; background: linear-gradient(145deg, #5485dc, #264b91); }
.route-line { background: linear-gradient(90deg, #6b9ce9, #f3ca65 78%); }
.route-stop.stop-current > span {
  border-color: #f7ce68;
  box-shadow: 0 0 18px rgba(247, 206, 104, .38);
}
.map-node.completed { border-color: #79aaff; background: #183864; }
.map-node.current { border-color: #f7ce68; box-shadow: 0 0 16px rgba(247, 206, 104, .35); }
.wallet-card {
  border-color: rgba(247, 206, 104, .34);
  background: linear-gradient(115deg, #263b61, #172944 75%);
}
.modal-header { background: #101d34; }
.icon-button,
.sheet-close { border-color: rgba(142, 175, 232, .2); background: #1a2c4b; }
.sheet {
  border-color: rgba(247, 206, 104, .25);
  background: linear-gradient(180deg, #1c3153, #111f37);
}
.choice-option:hover,
.choice-option:focus-visible {
  border-color: rgba(247, 206, 104, .62);
  background: rgba(247, 206, 104, .08);
}
.choice-icon { background: linear-gradient(135deg, #315ba3, #527de2); }
.choice-option[data-choice="friends"] .choice-icon { background: linear-gradient(135deg, #d9aa4d, #8d6c35); }
.match-result-card {
  background:
    radial-gradient(circle at 50% -14%, rgba(81, 126, 218, .22), transparent 15rem),
    linear-gradient(155deg, #172846, #0a1426 72%);
}
.match-game-pill {
  border-color: rgba(247, 206, 104, .3);
  background: rgba(247, 206, 104, .09);
}
@media (min-width: 820px) {
  .hero-card { min-height: 290px; }
}
