/* =========================================================
   سهمك الصاعد | تنسيقات المسابقة
   الهوية المشتركة في ../assets/athar.css
   ========================================================= */

/* ---------- أساسيات ---------- */
*{box-sizing:border-box; margin:0; padding:0;}
html{-webkit-text-size-adjust:100%;}
body{
  --up:#1FA971; --down:#E8554E;
  min-height:100vh; min-height:100dvh;
  background:var(--bg-paint); background-attachment:fixed;
  color:var(--text);
  font-family:"Thmanyah Sans","IBM Plex Sans Arabic",system-ui,sans-serif;
  font-weight:500; font-size:16px; line-height:1.7;
  display:flex; flex-direction:column; overflow-x:hidden;
}
h1,h2,h3,h4,strong,b{font-weight:700;}
button,input{font:inherit; color:inherit;}
button{cursor:pointer; -webkit-tap-highlight-color:transparent;}
button:disabled{cursor:not-allowed;}
ul,ol{list-style:none;}
[hidden]{display:none !important;}
:focus-visible{outline:3px solid var(--hl); outline-offset:2px;}
.muted{color:var(--text-2); font-size:.86rem;}

/* ---------- الشريط العلوي ---------- */
.topbar{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:10px clamp(14px,3vw,28px); border-bottom:1px solid var(--line);
}
.brand{display:flex; align-items:center; gap:10px; min-width:0; text-decoration:none; color:inherit;}
.brand .logo{height:52px; width:auto; flex:none;}
.brand-text{display:flex; flex-direction:column; min-width:0; line-height:1.35;}
.brand-text strong{font-size:1.15rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.brand-text small{color:var(--text-2); font-size:.8rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.top-tools{display:flex; align-items:center; gap:8px; flex:none;}

.icon-btn{
  width:42px; height:42px; border-radius:50%;
  display:grid; place-items:center;
  background:var(--surface); border:1px solid var(--line);
  transition:transform .15s ease, background .2s ease;
}
.icon-btn:hover{background:var(--surface-2);}
.icon-btn:active{transform:scale(.92);}
.icon-btn svg{width:22px; height:22px; fill:var(--text);}
.icon-btn .wave{stroke:var(--text);}
.icon-btn .ico-off{display:none;}
.icon-btn[aria-pressed="false"] .ico-on{display:none;}
.icon-btn[aria-pressed="false"] .ico-off{display:block; opacity:.6;}

/* ---------- الأزرار ---------- */
.btn{
  min-height:48px; padding:10px 20px;
  border-radius:14px; border:1px solid var(--line);
  background:var(--surface); color:var(--text);
  font-weight:700; font-size:1rem;
  transition:transform .15s ease, background .2s ease, filter .2s ease, opacity .2s;
}
.btn:hover:not(:disabled){background:var(--surface-2); transform:translateY(-2px);}
.btn:active:not(:disabled){transform:translateY(0) scale(.97);}
.btn:disabled{opacity:.35;}
.btn-primary{background:var(--accent); color:var(--on-accent); border-color:transparent; box-shadow:0 8px 22px rgba(30,111,224,.28);}
.btn-primary:hover:not(:disabled){background:var(--accent-hover);}
.btn-big{width:100%; min-height:58px; font-size:1.15rem; border-radius:18px;}
.btn-sm{min-height:40px; padding:6px 14px; font-size:.92rem; border-radius:12px;}
.btn-ghost{background:transparent; border-color:transparent; color:var(--text-2);}
.btn-buy{background:var(--up); color:#fff; border-color:transparent;}
.btn-sell{background:var(--down); color:#fff; border-color:transparent;}
.btn-buy:hover:not(:disabled),.btn-sell:hover:not(:disabled){filter:brightness(1.08); background:var(--up);}
.btn-sell:hover:not(:disabled){background:var(--down);}

/* ---------- الشاشات ---------- */
main{flex:1; padding:clamp(14px,3vw,28px);}
.screen{display:none;}
.screen.active{display:block; animation:screenIn .45s ease both;}
@keyframes screenIn{from{opacity:0; transform:translateY(14px);} to{opacity:1; transform:none;}}

/* ---------- ١) البداية ---------- */
.setup{max-width:680px; margin:0 auto;}
.setup-hero{text-align:center; margin-bottom:20px;}
.hero-logo{width:clamp(120px,22vw,170px); height:auto; margin:0 auto; animation:floaty 5s ease-in-out infinite;}
@keyframes floaty{50%{transform:translateY(-8px);}}
.setup-hero h1{font-size:clamp(2.2rem,8vw,3.4rem); line-height:1.35;}
.lead{color:var(--text-2); font-size:clamp(1rem,2.4vw,1.15rem); max-width:46ch; margin:4px auto 0;}

.card{
  background:var(--surface); border:1px solid var(--line); border-radius:20px;
  padding:18px; margin-bottom:14px; box-shadow:var(--shadow);
}
.card-head{display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-bottom:12px;}
.card-head h2,.resume h2{font-size:1.15rem;}

.resume{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; border-color:var(--accent);}
.resume-actions{display:flex; gap:8px; flex-wrap:wrap;}

.grid2{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:10px;}
.field{display:block; margin-bottom:12px;}
.field:last-child{margin-bottom:0;}
.field > span{display:block; font-size:.88rem; color:var(--text-2); margin-bottom:4px;}
input[type="text"],input[type="number"]{
  width:100%; height:48px; padding:0 14px;
  border-radius:13px; border:1px solid var(--line);
  background:var(--solid); color:var(--text); font-weight:700;
}
input::placeholder{color:var(--text-2); opacity:.6; font-weight:500;}

.chips{display:grid; gap:8px;}
.chips.c2{grid-template-columns:repeat(2,1fr);}
.chips.c3{grid-template-columns:repeat(3,1fr);}
.chips.c4{grid-template-columns:repeat(4,1fr);}
.chips.c5{grid-template-columns:repeat(5,1fr);}
.chip{
  min-height:46px; padding:4px 6px; border-radius:13px; border:1px solid var(--line);
  background:var(--solid); font-weight:700; font-size:1.02rem; line-height:1.4;
  transition:transform .15s ease, background .2s, color .2s;
}
.chip small{display:block; font-weight:500; font-size:.74rem; opacity:.8;}
.chip:hover{transform:translateY(-2px);}
.chip[aria-pressed="true"]{background:var(--accent); color:var(--on-accent); border-color:transparent;}
#counts{margin-bottom:12px;}

.team-inputs{display:flex; flex-direction:column; gap:8px;}
.team-row{display:flex; align-items:center; gap:8px; animation:screenIn .3s ease both;}
.team-no{
  flex:none; width:46px; height:46px; border-radius:13px;
  display:grid; place-items:center; background:var(--c); color:#fff;
  font-weight:700; font-size:1.15rem; border:2px solid rgba(255,255,255,.5);
}

.rules summary{font-weight:700; cursor:pointer; list-style-position:inside;}
.rules ul{margin-top:10px; padding-inline-start:20px; color:var(--text-2); font-size:.95rem; list-style:disc;}
.rules li{margin-bottom:6px;}
.rules strong{color:var(--text);}

.home-link{display:block; width:max-content; margin:12px auto 0; color:var(--text-2); font-weight:700; text-decoration:none; padding:6px 10px; border-radius:10px;}
.home-link:hover{background:var(--surface);}

/* ---------- ٢) اللعب ---------- */
.game{max-width:1240px; margin:0 auto; display:flex; flex-direction:column; gap:14px;}

.bar{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
.round-pill{
  padding:6px 16px; border-radius:999px; white-space:nowrap;
  background:var(--surface-2); border:1px solid var(--line); font-size:.95rem;
}
.bar #endBtn{margin-inline-start:auto;}

/* المؤقّت */
.timer{display:flex; align-items:center; gap:8px;}
.timer-ring{
  --p:1;
  width:56px; height:56px; border-radius:50%; flex:none;
  display:grid; place-items:center;
  background:conic-gradient(var(--accent) calc(var(--p) * 360deg), var(--surface-2) 0);
  transition:background .3s linear;
}
.timer-ring b{
  width:44px; height:44px; border-radius:50%;
  display:grid; place-items:center; background:var(--solid); font-size:1.15rem;
}
.timer-ring.low{background:conic-gradient(var(--down) calc(var(--p) * 360deg), var(--surface-2) 0); animation:pulse 1s ease-in-out infinite;}
.timer-ring.paused{opacity:.5; animation:none;}
@keyframes pulse{50%{transform:scale(1.08);}}

/* أرصدة الفرق */
.teams{display:grid; grid-template-columns:repeat(var(--n,3),minmax(0,1fr)); gap:10px;}
.team{
  display:flex; flex-direction:column; min-width:0;
  background:var(--surface); border:1px solid var(--line); border-top:6px solid var(--c);
  border-radius:16px; padding:8px 12px 10px; line-height:1.45;
  transition:transform .25s ease, box-shadow .25s ease;
}
.team.active{box-shadow:0 0 0 3px var(--c); transform:translateY(-3px);}
.team.bump .team-cash b{animation:bump .6s cubic-bezier(.3,1.8,.5,1);}
@keyframes bump{40%{transform:scale(1.25);}}
.team-name{font-weight:700; font-size:.95rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.team-cash b{display:inline-block; font-size:1.35rem;}
.team-cash small{color:var(--text-2); font-size:.75rem; margin-inline-start:4px;}
.team-wealth{color:var(--text-2); font-size:.8rem;}

/* التخطيط: المرحلة + شاشة الأسعار */
.layout{display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:14px; align-items:start;}
.layout[data-mode="full"]{grid-template-columns:minmax(0,1fr);}

.panel{
  background:var(--surface); border:1px solid var(--line); border-radius:22px;
  padding:clamp(16px,3vw,26px); box-shadow:var(--shadow);
  animation:screenIn .4s ease both;
}
.panel.center{text-align:center; padding-block:clamp(26px,6vw,54px);}
.kicker{color:var(--text-2); font-weight:700; font-size:1rem;}
.big{font-size:clamp(2rem,6.5vw,3.4rem); line-height:1.4; overflow-wrap:anywhere;}
.team-title{
  text-decoration:underline; text-decoration-color:var(--c);
  text-decoration-thickness:.13em; text-underline-offset:.2em; overflow-wrap:anywhere;
}
.panel.center .muted{margin:6px 0 22px; font-size:.95rem;}
.panel.center .btn-big{max-width:420px;}

/* السؤال */
.question{border-top:8px solid var(--c);}
.q-text{font-size:clamp(1.3rem,3.6vw,2.1rem); line-height:1.6; margin:4px 0 16px; overflow-wrap:anywhere;}
.opts{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
.opt{
  display:flex; align-items:center; gap:12px; text-align:start;
  min-height:64px; padding:10px 14px; border-radius:16px;
  background:var(--solid); border:2px solid var(--line);
  font-weight:700; font-size:clamp(1rem,2.2vw,1.2rem); line-height:1.5;
  transition:transform .15s ease, border-color .2s, background .2s;
}
.opt:hover:not(:disabled){transform:translateY(-2px); border-color:var(--accent);}
.opt:disabled{opacity:.6;}
.opt-l{
  flex:none; width:38px; height:38px; border-radius:11px;
  display:grid; place-items:center; background:var(--surface-2); color:var(--text);
}
.opt-t{min-width:0; overflow-wrap:anywhere;}
.opt.right{background:var(--up); border-color:var(--up); color:#fff; opacity:1; animation:bump .6s cubic-bezier(.3,1.8,.5,1);}
.opt.wrong{background:var(--down); border-color:var(--down); color:#fff; opacity:.85;}
.opt.right .opt-l,.opt.wrong .opt-l{background:rgba(255,255,255,.25); color:#fff;}
.q-tools{display:flex; justify-content:center; margin-top:12px;}
.judge{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
.judge .btn{min-height:72px; font-size:clamp(1.1rem,3vw,1.4rem); border-radius:18px;}
.question > .surprise:first-of-type{margin-top:8px;}

.buzz{margin-bottom:14px;}
.buzz-row{display:flex; flex-wrap:wrap; gap:8px; margin-top:4px;}
.buzz-btn{
  flex:1 1 120px; min-height:46px; padding:6px 12px; border-radius:13px;
  background:var(--solid); border:2px solid var(--c); font-weight:700;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  transition:transform .15s ease, background .2s, color .2s;
}
.buzz-btn.on{background:var(--c); color:#fff; transform:translateY(-2px);}
.buzz-btn:disabled{opacity:.35; text-decoration:line-through;}

.result,.surprise{
  display:flex; flex-direction:column; gap:2px;
  border-radius:16px; padding:12px 16px; margin-top:14px; color:#fff;
  animation:modalIn .4s cubic-bezier(.3,1.5,.5,1) both;
}
.result strong,.surprise strong{font-size:1.25rem;}
.result.ok{background:var(--up);}
.result.bad{background:var(--down);}
.surprise{background:var(--solid); color:var(--text); border:2px dashed var(--hl);}
.surprise.ok{border-color:var(--up);}
.surprise.bad{border-color:var(--down);}
.question > .btn-big{margin-top:14px;}

/* شاشة الأسعار الجانبية */
.board{
  background:var(--surface); border:1px solid var(--line); border-radius:22px;
  padding:14px; box-shadow:var(--shadow);
}
.board h3{font-size:1.05rem; margin-bottom:8px;}
.prices li{
  display:grid; grid-template-columns:minmax(0,1fr) 60px auto 62px; align-items:center; gap:8px;
  padding:6px 2px; border-bottom:1px solid var(--line);
}
.prices li:last-child{border-bottom:0;}
.p-name{font-weight:700; font-size:.95rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.p-price{font-size:1.05rem; text-align:end;}
.spark{width:60px; height:22px; direction:ltr;}
.spark path{fill:none; stroke:var(--accent); stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}

/* شارة التغيّر */
.chg{
  display:inline-flex; align-items:center; justify-content:center; gap:2px;
  min-width:58px; padding:1px 6px; border-radius:999px;
  font-weight:700; font-size:.82rem; color:#fff; white-space:nowrap;
}
.chg svg{width:14px; height:14px; fill:currentColor; flex:none;}
.chg.up{background:var(--up);}
.chg.down{background:var(--down);}
.chg.flat{background:var(--surface-2); color:var(--text-2);}

/* التداول */
.trade{border-top:8px solid var(--c);}
.trade-head{display:flex; align-items:flex-end; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px;}
.trade-head h2{font-size:clamp(1.4rem,4vw,2rem); line-height:1.5;}
.trade-stats{display:flex; gap:8px; flex-wrap:wrap;}
.trade-stats span{
  padding:4px 12px; border-radius:12px; background:var(--solid); border:1px solid var(--line);
  font-size:.86rem; color:var(--text-2); white-space:nowrap;
}
.trade-stats b{color:var(--text); font-size:1.05rem; margin-inline-start:4px;}
.t-list{display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:14px;}
.t-row{
  display:grid; grid-template-columns:minmax(0,1.2fr) auto minmax(0,1fr) auto; align-items:center; gap:10px;
  background:var(--solid); border:1px solid var(--line); border-radius:16px; padding:8px 12px;
}
.t-row.owned{border-color:var(--c); box-shadow:inset 4px 0 0 var(--c);}
[dir="rtl"] .t-row.owned{box-shadow:inset -4px 0 0 var(--c);}
.t-name{font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.t-price{display:flex; align-items:center; gap:6px;}
.t-price b{font-size:1.15rem;}
.t-own{font-size:.86rem; color:var(--text-2); white-space:nowrap;}
.t-own b{color:var(--text); font-size:1rem;}
.t-own i{font-style:normal; opacity:.6;}
.t-acts{display:flex; gap:6px;}

/* شاشة السوق */
.market-head{display:flex; align-items:flex-end; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px;}
.market-head h2{font-size:clamp(1.5rem,4.5vw,2.2rem); line-height:1.4;}
.market-sum{display:flex; gap:6px;}
.market-sum .chg{font-size:.9rem; padding:3px 10px;}
.m-list{display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:18px;}
.m-row{
  display:grid; grid-template-columns:minmax(0,1fr) auto auto auto auto; align-items:center; gap:10px;
  background:var(--solid); border:1px solid var(--line); border-radius:16px; padding:10px 14px;
}
.m-row.up{border-inline-start:6px solid var(--up);}
.m-row.down{border-inline-start:6px solid var(--down);}
.m-name{font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.m-old{color:var(--text-2); text-decoration:line-through; font-size:1.05rem;}
.m-arrow{color:var(--text-2);}
.m-new{font-size:1.3rem;}
.market.anim .m-row,.market.anim .rank{animation:rowIn .5s cubic-bezier(.3,1.4,.5,1) both; animation-delay:var(--d,0s);}
@keyframes rowIn{from{opacity:0; transform:translateY(16px) scale(.96);}}

.rank-title{font-size:1.05rem; margin-bottom:8px;}
.ranks{display:flex; flex-direction:column; gap:8px; margin-bottom:16px;}
.rank{
  display:grid; grid-template-columns:auto minmax(0,1fr) auto auto; align-items:center; gap:12px;
  background:var(--solid); border:1px solid var(--line); border-inline-start:8px solid var(--c);
  border-radius:16px; padding:8px 14px;
}
.rank-no{font-weight:700; font-size:1.15rem; color:var(--text-2);}
.rank-name{font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.rank-delta{font-weight:700; font-size:.9rem; color:var(--text-2); direction:ltr;}
.rank-delta.up{color:var(--up);}
.rank-delta.down{color:var(--down);}
[data-theme="blue"] .rank-delta.up,[data-theme="blue"] .rank-delta.down,
[data-theme="navy"] .rank-delta.up,[data-theme="navy"] .rank-delta.down{
  color:#fff; padding:0 8px; border-radius:999px;
}
[data-theme="blue"] .rank-delta.up,[data-theme="navy"] .rank-delta.up{background:var(--up);}
[data-theme="blue"] .rank-delta.down,[data-theme="navy"] .rank-delta.down{background:var(--down);}
.rank-w{font-size:1.25rem;}

/* ---------- ٣) الفوز ---------- */
#confetti{position:fixed; inset:0; width:100%; height:100%; pointer-events:none; z-index:5;}
.victory{position:relative; max-width:640px; margin:0 auto; text-align:center;}
.trophy{width:96px; height:96px; fill:var(--win,var(--accent)); stroke:var(--win,var(--accent)); filter:drop-shadow(0 8px 18px rgba(0,0,0,.2)); animation:floaty 2.4s ease-in-out infinite;}
.victory h1{
  font-size:clamp(2.2rem,9vw,4rem); line-height:1.35; overflow-wrap:anywhere;
  text-decoration:underline; text-decoration-color:var(--win,var(--accent));
  text-decoration-thickness:.14em; text-underline-offset:.22em;
  animation:winnerIn .9s cubic-bezier(.2,1.7,.4,1) both;
}
@keyframes winnerIn{0%{opacity:0; transform:scale(.2) rotate(-12deg);} 100%{opacity:1; transform:none;}}
.victory .lead{margin:14px auto 22px;}
.final{display:flex; flex-direction:column; gap:8px; margin-bottom:22px; text-align:start;}
.final-row{
  display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:12px;
  background:var(--surface); border:1px solid var(--line); border-inline-start:8px solid var(--c);
  border-radius:16px; padding:10px 14px; animation:screenIn .5s ease both;
}
.final-row.win{box-shadow:0 0 0 3px var(--c);}
.final-rank{font-weight:700; font-size:1.2rem; color:var(--text-2);}
.final-name{font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.final-pts{text-align:end; font-weight:700; font-size:1.25rem; line-height:1.3;}
.final-pts small{display:block; font-size:.72rem; font-weight:500; color:var(--text-2);}

/* ---------- النوافذ ---------- */
.modal{
  position:fixed; inset:0; z-index:80;
  display:grid; place-items:center; padding:20px;
  background:var(--scrim); backdrop-filter:blur(4px);
  animation:fade .2s ease both;
}
.modal-card{
  width:min(100%,440px); text-align:center;
  background:var(--solid); color:var(--text);
  border:1px solid var(--line); border-radius:24px; padding:26px 22px 22px;
  box-shadow:0 30px 60px rgba(0,0,0,.3);
  animation:modalIn .35s cubic-bezier(.3,1.5,.5,1) both;
}
.modal-card h3{font-size:1.4rem; line-height:1.5; margin-bottom:6px;}
.modal-card p{color:var(--text-2); margin-bottom:16px;}
.modal-actions{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
@keyframes fade{from{opacity:0;}}
@keyframes modalIn{from{opacity:0; transform:scale(.85) translateY(20px);}}

.qty{display:grid; grid-template-columns:54px 1fr 54px; gap:8px; margin-bottom:10px;}
.qty input{height:54px; text-align:center; font-size:1.5rem; background:var(--surface);}
.qty input::-webkit-outer-spin-button,.qty input::-webkit-inner-spin-button{-webkit-appearance:none; margin:0;}
.qty input{-moz-appearance:textfield; appearance:textfield;}
.step-btn{
  height:54px; border-radius:14px; border:1px solid var(--line);
  background:var(--surface); font-size:1.6rem; font-weight:700; line-height:1;
}
.step-btn:active{transform:scale(.94);}
.qty-quick{grid-template-columns:repeat(auto-fit,minmax(0,1fr)); margin-bottom:12px;}
.qty-quick .chip{background:var(--surface); font-size:.95rem;}
.modal-card p.sheet-total{font-size:1.1rem; color:var(--text);}
.sheet-total b{font-size:1.4rem;}

/* =========================================================
   هوية «سهمك الصاعد» الخاصة: منصة تداول وسوق أسهم
   شريط أسعار متحرك، شبكة رسوم بيانية، شموع، لوحة أسعار داكنة، أخضر للصعود وأحمر للهبوط
   ========================================================= */
:root,[data-theme="light"]{
  --up:#16A34A; --down:#DC2626; --gold:#F5B820; --gold-deep:#B7791F;
  --gridline:rgba(10,36,99,.06); --deco:#1E6FE0; --deco-op:.10;
  --term:#0B1B3F; --term-2:#12285A; --term-line:rgba(255,255,255,.08); --term-text:#E6F0FF; --term-dim:#8EA6D4;
  --press:#C6D8F1; --press-accent:#0F4FB0;
}
[data-theme="navy"]{--gridline:rgba(255,255,255,.05); --deco:#5CC2F5; --deco-op:.12; --term:#061230; --term-2:#0B1D47; --press:rgba(0,0,0,.4); --press-accent:#4C9FD8;}
[data-theme="blue"]{--gridline:rgba(255,255,255,.08); --deco:#FFFFFF; --deco-op:.14; --term:#0A2463; --term-2:#123581; --press:rgba(10,36,99,.32); --press-accent:#9CCBF3;}

/* ---------- خلفية المنصة: ورق رسوم بيانية ومؤشر كبير ---------- */
html{
  background:
    linear-gradient(var(--gridline) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--gridline) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--bg-paint);
  background-attachment:fixed; background-color:var(--bg);
}
body{background:transparent;}
html,body{overflow-x:clip;}
.market-bg{position:fixed; inset:0; z-index:0; pointer-events:none;}
.market-bg svg{width:100%; height:100%;}
.market-bg .mb-line{fill:none; stroke:var(--deco); stroke-width:5; stroke-linejoin:round; stroke-linecap:round; opacity:calc(var(--deco-op) * 1.6);}
.market-bg .mb-area{fill:var(--deco); opacity:calc(var(--deco-op) * .45);}
.topbar, main, .ticker{position:relative; z-index:1;}

/* ---------- شريط الأسعار المتحرك ---------- */
.ticker{
  display:flex; align-items:stretch; height:38px; overflow:hidden;
  background:var(--term); color:var(--term-text); border-bottom:2px solid var(--gold);
  font-variant-numeric:tabular-nums;
}
.ticker-tag{
  flex:none; display:grid; place-items:center; padding:0 14px;
  background:var(--gold); color:#0A2463; font-weight:700; font-size:.9rem;
}
.ticker-view{flex:1; min-width:0; overflow:hidden; direction:ltr; -webkit-mask:linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask:linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);}
.ticker-track{display:flex; width:max-content; height:100%; align-items:center; animation:tick var(--dur,48s) linear infinite;}
.ticker:hover .ticker-track{animation-play-state:paused;}
@keyframes tick{from{transform:translateX(-50%);} to{transform:translateX(0);}}
.tk{direction:rtl; display:inline-flex; align-items:center; gap:8px; padding:0 18px; white-space:nowrap; font-size:.92rem; border-inline-end:1px solid var(--term-line);}
.tk b{font-weight:700;}
.tk i{font-style:normal; font-weight:700; color:#fff;}
.tk em{font-style:normal; font-weight:700; font-size:.82rem;}
.tk em.up{color:#4ADE80;} .tk em.down{color:#F87171;} .tk em.flat{color:var(--term-dim);}

/* ---------- صورة البطل: شموع وسهم صاعد ---------- */
.hero-chart{width:clamp(200px,38vw,280px); margin:0 auto -2px;}
.hero-chart svg{width:100%; height:auto; display:block;}
.chart{overflow:visible;}
.chart .grid path{stroke:var(--text); stroke-width:1; opacity:.1; stroke-dasharray:3 5;}
.chart .shadow{fill:var(--text); opacity:.1;}
.chart .wick{stroke-width:2.5; stroke-linecap:round;}
.chart .candle.up rect{fill:var(--up);} .chart .candle.up .wick{stroke:var(--up);}
.chart .candle.dn rect{fill:var(--down);} .chart .candle.dn .wick{stroke:var(--down);}
.chart .candle{transform-box:fill-box; transform-origin:50% 100%; animation:candleIn .55s cubic-bezier(.3,1.5,.5,1) both; animation-delay:calc(var(--i) * 110ms);}
@keyframes candleIn{from{transform:scaleY(0); opacity:0;}}
.chart .trend{fill:none; stroke:var(--gold); stroke-width:5; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:100; animation:drawTrend 5s ease-in-out infinite; filter:drop-shadow(0 3px 4px rgba(0,0,0,.18));}
.chart .arrowhead{fill:var(--gold); animation:headIn 5s ease-in-out infinite;}
.chart .tip{fill:var(--gold); transform-box:fill-box; transform-origin:center; animation:tipPulse 1.4s ease-out infinite;}
@keyframes drawTrend{0%{stroke-dashoffset:100;} 35%,85%{stroke-dashoffset:0; opacity:1;} 100%{stroke-dashoffset:0; opacity:0;}}
@keyframes headIn{0%,30%{opacity:0;} 36%,85%{opacity:1;} 100%{opacity:0;}}
@keyframes tipPulse{0%{transform:scale(1); opacity:1;} 100%{transform:scale(2.6); opacity:0;}}
.chart .coin{fill:var(--gold); stroke:var(--gold-deep); stroke-width:2;}
.chart .coins{animation:coinsIn .8s cubic-bezier(.3,1.5,.5,1) .9s both;}
@keyframes coinsIn{from{transform:translateY(-40px); opacity:0;}}

/* ---------- أزرار مجسّمة ---------- */
.btn{box-shadow:0 5px 0 var(--press); transition:transform .12s ease, box-shadow .12s ease, background .2s ease, filter .2s, opacity .2s;}
.btn:hover:not(:disabled){transform:translateY(-1px);}
.btn:active:not(:disabled){transform:translateY(5px); box-shadow:0 0 0 var(--press);}
.btn-primary{box-shadow:0 6px 0 var(--press-accent), 0 14px 24px rgba(10,36,99,.2);}
.btn-primary:active:not(:disabled){box-shadow:0 0 0 var(--press-accent);}
.btn-buy{box-shadow:0 4px 0 #0E6B32;} .btn-sell{box-shadow:0 4px 0 #9B1C1C;}
.btn-buy:active:not(:disabled),.btn-sell:active:not(:disabled){transform:translateY(4px); box-shadow:none;}
.btn-ghost,.btn:disabled{box-shadow:none;}
.chip{box-shadow:0 4px 0 var(--press); transition:transform .12s ease, box-shadow .12s ease, background .2s, color .2s;}
.chip:active{transform:translateY(4px); box-shadow:none;}
.chip[aria-pressed="true"]{box-shadow:0 4px 0 var(--press-accent);}
.team-no{box-shadow:0 4px 0 color-mix(in srgb, var(--c) 62%, #000);}
.opt{box-shadow:0 4px 0 var(--press);}
.step-btn{box-shadow:0 4px 0 var(--press);}
.step-btn:active{transform:translateY(4px); box-shadow:none;}

/* بطاقات الفرق: محافظ */
.team{box-shadow:0 4px 0 var(--press);}
.team.active{box-shadow:0 0 0 3px var(--c), 0 6px 0 color-mix(in srgb, var(--c) 60%, #000);}
.team-cash b,.team-wealth,.p-price,.t-price b,.m-new,.m-old,.rank-w,.final-pts{font-variant-numeric:tabular-nums;}

/* ---------- لوحة الأسعار: شاشة تداول داكنة ---------- */
.board{background:linear-gradient(180deg, var(--term-2), var(--term)); border-color:rgba(255,255,255,.08); color:var(--term-text); box-shadow:0 18px 40px rgba(10,36,99,.28);}
.board h3{display:flex; align-items:center; gap:8px; color:#fff;}
.board h3::before{content:""; width:9px; height:9px; border-radius:50%; background:#4ADE80; box-shadow:0 0 0 0 rgba(74,222,128,.6); animation:liveDot 1.6s ease-out infinite;}
@keyframes liveDot{to{box-shadow:0 0 0 9px rgba(74,222,128,0);}}
.prices li{border-bottom-color:var(--term-line); border-radius:8px; padding-inline:6px;}
.board .p-name{color:var(--term-text);}
.board .p-price{color:#fff;}
.spark{width:64px; height:24px;}
.spark .sp-line{fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
.spark.up .sp-line{stroke:#4ADE80;} .spark.down .sp-line{stroke:#F87171;} .spark.flat .sp-line{stroke:var(--term-dim);}
.spark .sp-area{stroke:none; opacity:.22;}
.spark.up .sp-area{fill:#4ADE80;} .spark.down .sp-area{fill:#F87171;} .spark.flat .sp-area{fill:transparent;}
.prices li.flash-up{animation:flashUp 1.2s ease;}
.prices li.flash-down{animation:flashDown 1.2s ease;}
@keyframes flashUp{0%,30%{background:rgba(74,222,128,.28);} 100%{background:transparent;}}
@keyframes flashDown{0%,30%{background:rgba(248,113,113,.28);} 100%{background:transparent;}}

/* ---------- شاشة السوق: مؤشر أثَر ---------- */
.index-card{
  display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:16px;
  background:linear-gradient(180deg, var(--term-2), var(--term)); color:var(--term-text);
  border-radius:18px; padding:14px 18px; margin-bottom:14px; box-shadow:0 12px 30px rgba(10,36,99,.25);
}
.index-card .ix-label{font-size:.85rem; color:var(--term-dim); font-weight:700;}
.index-card .ix-val{font-size:clamp(1.8rem,5vw,2.6rem); font-weight:700; line-height:1.2; color:#fff; font-variant-numeric:tabular-nums;}
.index-card .ix-chg{display:inline-block; margin-top:2px;}
.ix-chart{width:100%; height:86px; direction:ltr;}
.ix-chart .ix-line{fill:none; stroke-width:3; stroke-linecap:round; stroke-linejoin:round;}
.ix-chart.up .ix-line{stroke:#4ADE80;} .ix-chart.down .ix-line{stroke:#F87171;}
.ix-chart .ix-area{opacity:.2;}
.ix-chart.up .ix-area{fill:#4ADE80;} .ix-chart.down .ix-area{fill:#F87171;}
.ix-chart .ix-base{stroke:var(--term-line); stroke-width:1.5; stroke-dasharray:4 5;}
.ix-wrap{position:relative; direction:ltr;}
.ix-chart .ix-line,.ix-chart .ix-base{vector-effect:non-scaling-stroke;}
.ix-dot{position:absolute; width:12px; height:12px; margin:-6px 0 0 -6px; border-radius:50%; border:2px solid #fff;}
.ix-wrap.up .ix-dot{background:#4ADE80; box-shadow:0 0 0 0 rgba(74,222,128,.6); animation:liveDot 1.6s ease-out infinite;}
.ix-wrap.down .ix-dot{background:#F87171;}
.market.anim .ix-line{stroke-dasharray:1000; animation:ixDraw 1.4s ease-out both;}
@keyframes ixDraw{from{stroke-dashoffset:1000;}}

/* ---------- الفوز: سهم صاعد بلون الفائز مع عملات ---------- */
.trophy{width:clamp(200px,34vw,260px); height:auto; fill:initial; stroke:none; filter:none; animation:none;}
.trophy .trend,.trophy .arrowhead,.trophy .tip{--gold-line:var(--win,var(--gold));}
.trophy .trend{stroke:var(--win,var(--gold)); stroke-width:7;}
.trophy .arrowhead,.trophy .tip{fill:var(--win,var(--gold));}

/* ---------- أشرطة الصوت المتمايلة ---------- */
.snd .bars{display:flex; align-items:center; gap:3px; height:20px;}
.snd .bars i{width:3.5px; height:100%; border-radius:3px; background:var(--text); transform-origin:50% 100%; transform:scaleY(.35);}
.snd[aria-pressed="true"] .bars i{animation:eq 1s ease-in-out infinite;}
.snd[aria-pressed="true"] .bars i:nth-child(2){animation-delay:-.35s; animation-duration:.8s;}
.snd[aria-pressed="true"] .bars i:nth-child(3){animation-delay:-.6s; animation-duration:1.15s;}
.snd[aria-pressed="true"] .bars i:nth-child(4){animation-delay:-.2s; animation-duration:.9s;}
@keyframes eq{0%,100%{transform:scaleY(.3);} 50%{transform:scaleY(1);}}
.snd[aria-pressed="false"] .bars{position:relative; opacity:.5;}
.snd[aria-pressed="false"] .bars i{transform:scaleY(.22);}
.snd[aria-pressed="false"] .bars::after{content:""; position:absolute; left:-3px; right:-3px; top:50%; height:2.5px; border-radius:2px; background:var(--text); transform:rotate(-38deg);}

@media (max-width:600px){
  .ticker{height:34px;}
  .tk{font-size:.84rem; padding:0 12px;}
  .index-card{grid-template-columns:minmax(0,1fr); gap:6px;}
}
@media (prefers-reduced-motion:reduce){.ticker-track{animation:none;}}

/* ---------- التجاوب ---------- */
@media (max-width:1020px){
  .layout{grid-template-columns:minmax(0,1fr);}
  .prices{display:grid; grid-template-columns:1fr 1fr; column-gap:18px;}
  .prices li:nth-last-child(2){border-bottom:0;}
}
@media (max-width:860px){
  .t-list,.m-list{grid-template-columns:minmax(0,1fr);}
  .teams{grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media (max-width:600px){
  .brand .logo{height:44px;}
  .brand-text strong{font-size:1rem;}
  .theme-dot{width:26px; height:26px;}
  .icon-btn{width:38px; height:38px;}
  .grid2{grid-template-columns:minmax(0,1fr);}
  .chips.c5 .chip{font-size:.92rem;}
  .chips.c3 .chip{font-size:.9rem;}
  .chips.c3 .chip small{font-size:.68rem;}
  .teams{grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px;}
  .team-cash b{font-size:1.15rem;}
  .opts{grid-template-columns:minmax(0,1fr);}
  .opt{min-height:56px;}
  .prices{grid-template-columns:minmax(0,1fr);}
  .prices li:nth-last-child(2){border-bottom:1px solid var(--line);}
  .t-row{grid-template-columns:minmax(0,1fr) auto; row-gap:6px;}
  .t-own{order:3;}
  .t-acts{order:4; justify-content:flex-end;}
  .m-row{gap:6px; padding:8px 10px;}
  .m-new{font-size:1.15rem;}
  .timer-ring{width:48px; height:48px;}
  .timer-ring b{width:38px; height:38px; font-size:1rem;}
  .bar #endBtn{padding-inline:8px;}
}
@media (max-width:380px){
  .brand-text small{display:none;}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important;}
}
.q-cat{display:inline-block; font-size:.78rem; font-weight:500; color:var(--text-2); background:var(--surface-2); border-radius:999px; padding:1px 10px; margin-inline-start:6px;}
