/* ═══════════════ صالون السبعة — آرت ديكو ═══════════════ */
:root{
  --ink:#0A0C10;
  --velvet:#101010;
  --gold:#C8A96A;
  --gold-dim:rgba(200,169,106,.42);
  --gold-line:rgba(200,169,106,.26);
  --ivory:#F5F2EC;
  --dim:rgba(245,242,236,.56);
  --faint:rgba(245,242,236,.14);
  --silver:#CFD4D8;
  --bronze:#8C6F45;
  --pearl:#EFEAE1;
  --cut:14px;
  --accent:var(--gold);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
html,body{height:100%;margin:0;padding:0;}
body{
  background:#07080B;
  color:var(--ivory);
  font-family:"Tajawal",system-ui,-apple-system,sans-serif;
  font-weight:400;
  overflow:hidden;
  overscroll-behavior:none;
  -webkit-user-select:none;user-select:none;
}
button{font-family:inherit;color:inherit;border:0;background:none;cursor:pointer;-webkit-user-select:none;user-select:none;}
input{font-family:inherit;}
.hidden{display:none !important;}

#gameRoot{
  position:relative;
  display:flex;
  flex-direction:column;
  height:100%;
  width:100%;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(200,169,106,.09), transparent 62%),
    linear-gradient(180deg,#0A0C10 0%,#0C0D10 46%,#101014 100%);
  overflow:hidden;
}

/* ── HUD ── */
.hud{
  flex:0 0 auto;
  padding:8px 10px 6px;
  border-bottom:1px solid var(--gold-line);
  background:linear-gradient(180deg,rgba(12,13,17,.96),rgba(12,13,17,.72));
}
.hud-row{display:flex;align-items:baseline;justify-content:space-between;gap:8px;min-width:0;}
.hud-meta{display:flex;align-items:baseline;gap:8px;min-width:0;overflow:hidden;}
.hud-kicker{
  font-size:10px;letter-spacing:.04em;color:var(--gold);
  white-space:nowrap;font-weight:700;
}
.hud-name{
  font-family:"Almarai","Tajawal",sans-serif;
  font-size:13px;font-weight:800;color:var(--ivory);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.hud-round{
  font-size:10px;color:var(--dim);white-space:nowrap;font-weight:500;
  flex:0 0 auto;
}
.hud-players{
  display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin-top:6px;
}
.hp{
  display:flex;align-items:center;gap:4px;min-width:0;
  padding:4px 5px;border:1px solid rgba(245,242,236,.09);
  background:rgba(255,255,255,.025);
  clip-path:polygon(6px 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%,0 6px);
  transition:opacity .25s ease,border-color .25s ease,background .25s ease;
  opacity:.45;
}
.hp.active{border-color:var(--accent);opacity:1;background:rgba(200,169,106,.10);box-shadow:inset 0 0 0 1px rgba(200,169,106,.18);}
.hp-av{width:20px;height:20px;object-fit:contain;flex:0 0 auto;filter:drop-shadow(0 1px 2px rgba(0,0,0,.7));}
.hp-txt{display:flex;flex-direction:column;min-width:0;line-height:1;}
.hp-name{font-size:9px;color:var(--dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;}
.hp-score{font-size:13px;font-weight:800;color:var(--accent);font-family:"Almarai",sans-serif;letter-spacing:.02em;}
.hp-score.pop{animation:scorePop .5s cubic-bezier(.2,1.6,.4,1);}
@keyframes scorePop{0%{transform:translateY(0) scale(1);}35%{transform:translateY(-6px) scale(1.22);color:#fff;}100%{transform:translateY(0) scale(1);}}

/* ── STAGE ── */
.stage{position:relative;flex:1 1 auto;min-height:0;overflow:hidden;}
.stage canvas{display:block;width:100%;height:100%;touch-action:none;}

/* ── DOCK ── */
.dock{
  flex:0 0 auto;display:flex;align-items:center;gap:10px;
  padding:8px 12px;min-height:58px;
  border-top:1px solid var(--gold-line);
  background:linear-gradient(0deg,rgba(12,13,17,.98),rgba(12,13,17,.7));
}
.dock-btn{
  width:46px;height:46px;flex:0 0 auto;display:grid;place-items:center;
  border:1px solid var(--gold-line);background:rgba(200,169,106,.06);
  clip-path:polygon(9px 0,100% 0,100% calc(100% - 9px),calc(100% - 9px) 100%,0 100%,0 9px);
  transition:background .18s ease,transform .12s ease,opacity .18s ease;
}
.dock-btn svg{width:20px;height:20px;fill:var(--gold);}
.dock-btn:active{transform:scale(.94);background:rgba(200,169,106,.18);}
.dock-btn[disabled]{opacity:.3;}
.dock-btn.ghost svg{fill:var(--silver);}
.dock-btn.ghost[aria-pressed="false"]{opacity:.4;}
.dock-hint{
  flex:1 1 auto;text-align:center;font-size:11.5px;color:var(--dim);
  line-height:1.4;overflow:hidden;
}

/* ── OVERLAYS ── */
.ov{
  position:absolute;inset:0;z-index:60;
  display:flex;align-items:flex-start;justify-content:center;
  padding:14px 12px 22px;
  overflow-y:auto;-webkit-overflow-scrolling:touch;
  background:rgba(7,8,11,.78);
  -webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px);
  animation:ovIn .3s ease both;
}
.ov.center{align-items:center;}
@keyframes ovIn{from{opacity:0;}to{opacity:1;}}
.ov-card{
  width:100%;max-width:460px;margin:auto;
  padding:22px 18px 20px;
  background:
    linear-gradient(160deg,rgba(28,28,32,.98),rgba(14,14,17,.99));
  box-shadow:inset 0 0 0 1px var(--gold-line),0 24px 60px -20px rgba(0,0,0,.9);
  clip-path:polygon(var(--cut) 0,100% 0,100% calc(100% - var(--cut)),calc(100% - var(--cut)) 100%,0 100%,0 var(--cut));
  position:relative;
  animation:cardIn .34s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes cardIn{from{opacity:0;transform:translateY(14px);}to{opacity:1;transform:translateY(0);}}
.ov-card.wide{max-width:640px;}
.ov-card.narrow{max-width:340px;text-align:center;}

.deco-top{display:flex;align-items:center;justify-content:center;gap:10px;margin-bottom:12px;}
.deco-top span{display:block;height:1px;width:46px;background:linear-gradient(90deg,transparent,var(--gold-dim),transparent);}
.deco-top i{display:block;width:7px;height:7px;background:var(--gold);transform:rotate(45deg);}

.h-title{
  margin:0 0 6px;text-align:center;
  font-family:"Almarai","Tajawal",sans-serif;font-weight:800;
  font-size:27px;letter-spacing:.01em;color:var(--ivory);
  line-height:1.25;
}
.h-title.sm{font-size:20px;}
.h-sub{margin:0 0 18px;text-align:center;font-size:13px;color:var(--dim);line-height:1.6;font-weight:300;}
.h-sub.sm{font-size:12px;margin-bottom:14px;}
.micro{margin:14px 0 0;text-align:center;font-size:10.5px;color:rgba(245,242,236,.36);line-height:1.6;}

/* ── BUTTONS ── */
.btn{
  display:block;width:100%;min-height:50px;margin-top:10px;
  font-size:15px;font-weight:700;letter-spacing:.01em;
  clip-path:polygon(11px 0,100% 0,100% calc(100% - 11px),calc(100% - 11px) 100%,0 100%,0 11px);
  transition:transform .12s ease,background .2s ease,opacity .2s ease;
  display:flex;align-items:center;justify-content:center;
}
.btn:active{transform:scale(.985);}
.btn-gold{
  background:linear-gradient(135deg,#D9BC7C,#C8A96A 55%,#A98A4E);
  color:#141109;font-weight:800;
  box-shadow:0 10px 26px -12px rgba(200,169,106,.8);
}
.btn-gold:active{background:linear-gradient(135deg,#EFD79C,#D6B77A);}
.btn-gold[disabled]{opacity:.3;box-shadow:none;background:#3a352b;color:rgba(245,242,236,.5);}
.btn-ghost{
  background:transparent;color:var(--ivory);
  box-shadow:inset 0 0 0 1px var(--gold-line);
}
.btn-ghost:active{background:rgba(200,169,106,.10);}
.btn-mini{
  font-size:12px;color:var(--dim);padding:6px 10px;
  box-shadow:inset 0 0 0 1px var(--gold-line);
  clip-path:polygon(7px 0,100% 0,100% calc(100% - 7px),calc(100% - 7px) 100%,0 100%,0 7px);
}
.btn-mini:active{color:var(--gold);}

/* ── SEATS ── */
.seats{display:flex;flex-direction:column;gap:8px;margin-bottom:18px;}
.seat{
  padding:10px 11px 9px;
  background:rgba(255,255,255,.022);
  box-shadow:inset 0 0 0 1px rgba(245,242,236,.08);
  border-inline-start:2px solid var(--accent);
  clip-path:polygon(9px 0,100% 0,100% calc(100% - 9px),calc(100% - 9px) 100%,0 100%,0 9px);
}
.seat-top{display:flex;align-items:center;gap:10px;}
.seat-av{
  width:46px;height:46px;object-fit:contain;flex:0 0 auto;
  background:radial-gradient(circle at 50% 60%,rgba(200,169,106,.16),transparent 68%);
  filter:drop-shadow(0 3px 8px rgba(0,0,0,.7));
}
.seat-fields{flex:1 1 auto;min-width:0;}
.seat-lab{display:block;font-size:9.5px;color:var(--accent);font-weight:700;letter-spacing:.05em;margin-bottom:1px;}
.seat-name{
  width:100%;background:transparent;border:0;border-bottom:1px solid rgba(245,242,236,.16);
  color:var(--ivory);font-size:15px;font-weight:500;padding:3px 0 4px;
  outline:none;transition:border-color .2s ease;
}
.seat-name:focus{border-bottom-color:var(--accent);}
.seat-avs{display:flex;gap:6px;margin-top:8px;}
.av-pick{
  width:36px;height:36px;display:grid;place-items:center;
  box-shadow:inset 0 0 0 1px rgba(245,242,236,.1);
  background:rgba(255,255,255,.02);
  transition:box-shadow .18s ease,background .18s ease,transform .12s ease;
  clip-path:polygon(8px 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%,0 8px);
}
.av-pick img{width:28px;height:28px;object-fit:contain;}
.av-pick[aria-pressed="true"]{background:rgba(200,169,106,.14);box-shadow:inset 0 0 0 1px var(--gold);}
.av-pick:active{transform:scale(.92);}

/* ── PICKER ── */
.pick-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px;}
.pick-count{
  font-size:12px;color:var(--dim);letter-spacing:.06em;
  padding:5px 11px;box-shadow:inset 0 0 0 1px var(--gold-line);
  clip-path:polygon(7px 0,100% 0,100% calc(100% - 7px),calc(100% - 7px) 100%,0 100%,0 7px);
}
.pick-count b{color:var(--gold);font-size:15px;font-family:"Almarai",sans-serif;}
.games-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(148px,1fr));
  gap:8px;margin-bottom:16px;
}
.game-card{
  display:flex;align-items:center;gap:8px;text-align:start;
  padding:10px 10px;min-height:64px;
  background:rgba(255,255,255,.022);
  box-shadow:inset 0 0 0 1px rgba(245,242,236,.075);
  clip-path:polygon(9px 0,100% 0,100% calc(100% - 9px),calc(100% - 9px) 100%,0 100%,0 9px);
  transition:box-shadow .2s ease,background .2s ease,transform .12s ease;
  position:relative;
}
.game-card:active{transform:scale(.98);}
.game-card .gc-glyph{
  font-size:18px;color:rgba(200,169,106,.55);flex:0 0 auto;width:20px;text-align:center;
}
.game-card .gc-body{display:flex;flex-direction:column;min-width:0;flex:1 1 auto;}
.game-card .gc-name{font-size:12.5px;font-weight:700;color:var(--ivory);line-height:1.3;}
.game-card .gc-desc{font-size:9.5px;color:var(--dim);line-height:1.4;margin-top:2px;}
.game-card .gc-dur{font-size:9px;color:rgba(245,242,236,.34);flex:0 0 auto;align-self:flex-start;}
.game-card.sel{
  background:linear-gradient(140deg,rgba(200,169,106,.16),rgba(200,169,106,.05));
  box-shadow:inset 0 0 0 1px var(--gold);
}
.game-card.sel .gc-glyph{color:var(--gold);}
.game-card.sel::after{
  content:"";position:absolute;top:6px;left:6px;width:6px;height:6px;background:var(--gold);transform:rotate(45deg);
}
.game-card.shake{animation:shk .34s ease;}
@keyframes shk{0%,100%{transform:translateX(0);}20%{transform:translateX(-5px);}50%{transform:translateX(5px);}80%{transform:translateX(-3px);}}
.pick-actions{display:flex;flex-direction:column;gap:8px;}
.pick-actions .btn{margin-top:0;}

/* ── COUNTDOWN ── */
.count-wrap{text-align:center;padding:20px;}
.count-kicker{font-size:11px;letter-spacing:.22em;color:var(--gold);margin-bottom:18px;}
.count-player{
  font-family:"Almarai",sans-serif;font-weight:800;font-size:25px;color:var(--ivory);
  margin-bottom:6px;line-height:1.2;
}
.count-game{font-size:13px;color:var(--dim);margin-bottom:22px;}
.count-num{
  font-family:"Almarai",sans-serif;font-weight:800;font-size:76px;line-height:1;
  color:var(--gold);text-shadow:0 0 46px rgba(200,169,106,.42);
}
.count-num.pop{animation:cpop .5s cubic-bezier(.2,1.5,.4,1);}
@keyframes cpop{0%{transform:scale(.62);opacity:.2;}60%{transform:scale(1.08);opacity:1;}100%{transform:scale(1);}}
.count-hint{margin-top:18px;font-size:11.5px;color:rgba(245,242,236,.4);}

/* ── ROUND END ── */
.round-av{width:84px;height:84px;object-fit:contain;margin:0 auto 6px;display:block;filter:drop-shadow(0 8px 18px rgba(0,0,0,.8));animation:cpop .5s cubic-bezier(.2,1.5,.4,1);}
.round-name{font-family:"Almarai",sans-serif;font-weight:800;font-size:18px;color:var(--ivory);}
.round-lab{font-size:11px;color:var(--dim);margin-top:12px;letter-spacing:.06em;}
.round-score{
  font-family:"Almarai",sans-serif;font-weight:800;font-size:52px;color:var(--gold);
  line-height:1.1;margin-bottom:14px;letter-spacing:.02em;
}

/* ── GAME SUMMARY ── */
.sum-kicker{font-size:10px;letter-spacing:.16em;color:var(--gold);text-align:center;margin-bottom:6px;}
.sum-rows{display:flex;flex-direction:column;gap:6px;margin:16px 0 6px;}
.sum-row{
  display:flex;align-items:center;gap:9px;padding:8px 10px;
  background:rgba(255,255,255,.022);
  box-shadow:inset 0 0 0 1px rgba(245,242,236,.07);
  border-inline-start:2px solid var(--accent);
}
.sum-row.top{background:rgba(200,169,106,.12);box-shadow:inset 0 0 0 1px rgba(200,169,106,.4);}
.sum-row img{width:28px;height:28px;object-fit:contain;flex:0 0 auto;}
.sum-row .sr-name{flex:1 1 auto;font-size:12.5px;font-weight:500;color:var(--ivory);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.sum-row .sr-raw{font-size:11px;color:var(--dim);flex:0 0 auto;}
.sum-row .sr-pts{font-size:14px;font-weight:800;color:var(--gold);font-family:"Almarai",sans-serif;min-width:44px;text-align:end;flex:0 0 auto;}
.sum-row .sr-pts.bonus{color:#F0DFAE;}

/* ── PODIUM ── */
.medal{
  width:56px;height:56px;margin:0 auto 10px;border-radius:50%;
  display:grid;place-items:center;
  box-shadow:0 0 0 1px var(--gold),0 0 0 6px rgba(200,169,106,.09),0 0 34px rgba(200,169,106,.28);
  background:radial-gradient(circle at 50% 30%,rgba(200,169,106,.24),transparent 70%);
}
.medal span{font-size:24px;color:var(--gold);line-height:1;}
.podium{display:flex;align-items:flex-end;justify-content:center;gap:6px;margin:16px 0 8px;}
.pod{flex:1 1 0;max-width:120px;text-align:center;display:flex;flex-direction:column;align-items:center;}
.pod img{width:44px;height:44px;object-fit:contain;filter:drop-shadow(0 4px 10px rgba(0,0,0,.7));}
.pod-name{font-size:10.5px;color:var(--ivory);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;}
.pod-pts{font-size:12px;font-weight:800;color:var(--gold);font-family:"Almarai",sans-serif;}
.pod-base{
  width:100%;margin-top:6px;display:grid;place-items:center;
  font-family:"Almarai",sans-serif;font-weight:800;font-size:15px;color:#141109;
  background:linear-gradient(180deg,#D9BC7C,#B2924F);
  clip-path:polygon(8px 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%,0 8px);
}
.pod.p1 .pod-base{height:74px;background:linear-gradient(180deg,#EFD79C,#C8A96A);}
.pod.p2 .pod-base{height:54px;background:linear-gradient(180deg,#E2E6E9,#AEB6BC);}
.pod.p3 .pod-base{height:40px;background:linear-gradient(180deg,#B08E5E,#7C6139);color:#F5F2EC;}
.pod.p1 img{width:56px;height:56px;}
.fourth{
  text-align:center;font-size:11px;color:var(--dim);margin-bottom:16px;
  display:flex;align-items:center;justify-content:center;gap:6px;
}
.fourth img{width:22px;height:22px;object-fit:contain;}
.pg-title{
  font-size:10px;letter-spacing:.16em;color:var(--gold);text-align:center;
  margin:14px 0 8px;padding-top:12px;border-top:1px solid rgba(200,169,106,.16);
}
.pg-list{display:flex;flex-direction:column;gap:4px;margin-bottom:14px;}
.pg-row{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--dim);padding:4px 2px;}
.pg-row .pg-name{flex:1 1 auto;color:rgba(245,242,236,.8);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.pg-row img{width:18px;height:18px;object-fit:contain;}
.pg-row .pg-pts{color:var(--gold);font-weight:800;font-family:"Almarai",sans-serif;font-size:11.5px;}
.board-box{margin:6px 0 14px;}
.board-note{
  font-size:11px;color:var(--dim);text-align:center;line-height:1.7;
  padding:12px;box-shadow:inset 0 0 0 1px rgba(245,242,236,.08);
}
.lb-list{display:flex;flex-direction:column;gap:3px;margin-top:8px;}
.lb-row{display:flex;align-items:center;gap:8px;font-size:11.5px;padding:5px 8px;background:rgba(255,255,255,.02);}
.lb-row.you{background:rgba(200,169,106,.12);box-shadow:inset 0 0 0 1px rgba(200,169,106,.32);}
.lb-row .lb-rank{width:18px;color:var(--gold);font-weight:800;text-align:center;flex:0 0 auto;}
.lb-row .lb-handle{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.lb-row .lb-score{color:var(--gold);font-weight:800;font-family:"Almarai",sans-serif;flex:0 0 auto;}
.lb-cap{font-size:9px;color:rgba(245,242,236,.3);text-align:center;margin-top:6px;line-height:1.6;}
.podium-actions{display:flex;flex-direction:column;gap:8px;}

/* toasts */
#toast{
  position:fixed;bottom:86px;left:50%;transform:translateX(-50%) translateY(16px);
  background:rgba(20,20,24,.96);color:var(--ivory);
  padding:10px 18px;font-size:12.5px;
  box-shadow:inset 0 0 0 1px var(--gold-line),0 16px 40px -12px #000;
  opacity:0;pointer-events:none;transition:opacity .25s ease,transform .25s ease;
  z-index:200;white-space:nowrap;max-width:88vw;overflow:hidden;text-overflow:ellipsis;
  clip-path:polygon(9px 0,100% 0,100% calc(100% - 9px),calc(100% - 9px) 100%,0 100%,0 9px);
}
#toast.show{opacity:1;transform:translateX(-50%) translateY(0);}

/* short screens */
@media (max-height:620px){
  .ov-card{padding:16px 14px 14px;}
  .h-title{font-size:22px;}
  .h-sub{margin-bottom:12px;}
  .seat-av{width:38px;height:38px;}
  .count-num{font-size:58px;}
  .medal{width:44px;height:44px;}
  .medal span{font-size:19px;}
}
@media (min-width:720px){
  .games-grid{grid-template-columns:repeat(3,1fr);}
  .hud-players{gap:8px;}
  .hp-av{width:24px;height:24px;}
  .hp-score{font-size:15px;}
  .hp-name{font-size:10px;}
  .hud-name{font-size:15px;}
  .dock-hint{font-size:13px;}
}
@media (prefers-reduced-motion:reduce){
  *{animation-duration:.001ms !important;transition-duration:.001ms !important;}
}