@font-face{font-family:Cairo;src:url(./assets/cairo-arabic.woff2)}@font-face{font-family:Cairo;src:url(./assets/cairo-latin.woff2);unicode-range:U+0000-00FF}/* dalia - dusk harbour UI */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden; background: #05060a;
  font-family: 'Cairo', 'Noto Kufi Arabic', 'Droid Arabic Kufi', Tahoma, sans-serif;
  color: #f4efe6; user-select: none; -webkit-user-select: none;
  touch-action: none; overscroll-behavior: none;
}
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; background: #0a0d14;
   }
#grade { position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background: radial-gradient(ellipse at 50% 46%, rgba(0,0,0,0) 42%, rgba(4,4,10,0.5) 100%); }
#grain { display: none; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.hidden { display: none !important; }

/* ---------------- top bar */
#topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between;
  align-items: flex-start; padding: 14px 18px; gap: 12px; }
.panel { background: rgba(8,10,14,0.55); border: 1px solid rgba(255,190,130,0.18);
  border-radius: 10px;  padding: 8px 12px; }
#vitals { display: flex; flex-direction: column; gap: 6px; min-width: 190px; }
#health-row { display: flex; align-items: center; gap: 8px; direction: rtl; }
#health-bar { width: 150px; height: 9px; border-radius: 5px; background: rgba(255,255,255,0.13); overflow: hidden; }
#health-fill { height: 100%; width: 100%; background: linear-gradient(90deg,#3fd06a,#8ef0a8);
  border-radius: 5px; transition: width .18s ease; }
#health-num { font-size: 13px; font-weight: 700; color: #e8e2d8; min-width: 26px; text-align: center; }
#ammo-row { display: flex; align-items: baseline; gap: 6px; direction: rtl; }
#ammo-num { font-size: 24px; font-weight: 900; color: #ffcf94; line-height: 1; }
#ammo-row .sep { opacity: .4; }
#mag-num { font-size: 14px; opacity: .75; }
#weapon-name { font-size: 12px; opacity: .8; margin-right: auto; }
#objective { font-size: 13px; color: #ffd9a8; direction: rtl; text-align: right; max-width: 44vw; }
#right-top { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#btn-pause { pointer-events: auto; width: 38px; height: 38px; border-radius: 9px; border: 1px solid rgba(255,190,130,.25);
  background: rgba(8,10,14,.6); color: #ffcf94; font-size: 15px; cursor: pointer; }

/* ---------------- crosshair */
#crosshair { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  --spread: 12px; opacity: .9; }
#crosshair .t { position: absolute; background: rgba(255,240,220,.92); box-shadow: 0 0 4px rgba(0,0,0,.9); }
#crosshair .t.v { width: 2px; height: 8px; left: 21px; }
#crosshair .t.h { height: 2px; width: 8px; top: 21px; }
#crosshair .t.up { top: calc(22px - var(--spread) - 8px); }
#crosshair .t.down { top: calc(22px + var(--spread)); }
#crosshair .t.left { left: calc(22px - var(--spread) - 8px); }
#crosshair .t.right { left: calc(22px + var(--spread)); }
#crosshair .dot { position: absolute; left: 21px; top: 21px; width: 2px; height: 2px; background: #fff; border-radius: 50%; }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; opacity: 0; }
#hitmarker::before, #hitmarker::after { content: ''; position: absolute; left: 12px; top: 0; width: 2px; height: 26px;
  background: #fff; box-shadow: 0 0 6px #ff8a4a; }
#hitmarker::before { transform: rotate(45deg); }
#hitmarker::after { transform: rotate(-45deg); }
#hitmarker.hit { animation: hitpop .22s ease-out; }
#dmgnums { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.dmgnum { position: absolute; transform: translate(-50%,-50%); font-family: Cairo, sans-serif; font-weight: 800;
  font-size: 20px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.75); opacity: 0; animation: dmgfloat .8s ease-out forwards; }
.dmgnum.head { color: #ffc93a; font-size: 26px; text-shadow: 0 0 10px rgba(255,160,20,.6), 0 1px 4px rgba(0,0,0,.8); }
@keyframes dmgfloat { 0% { opacity: 0; margin-top: 0; } 12% { opacity: 1; } 100% { opacity: 0; margin-top: -46px; } }
#dmgdir { position: absolute; left: 50%; top: 50%; width: 110px; height: 110px; margin: -55px 0 0 -55px;
  pointer-events: none; opacity: 0; }
#dmgdir .arc { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from -35deg, rgba(255,60,40,.95), rgba(255,60,40,.95) 70deg, transparent 70deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 16px), #000 calc(100% - 15px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 16px), #000 calc(100% - 15px)); }
#dmgdir.show { animation: dmgdirfade .75s ease-out; }
@keyframes dmgdirfade { 0% { opacity: 1; } 100% { opacity: 0; } }

#hitmarker.head::before, #hitmarker.head::after { background: #ff5a4a; box-shadow: 0 0 8px #ff2a1a; }
@keyframes hitpop { 0% { opacity: 1; transform: scale(1.5); } 100% { opacity: 0; transform: scale(1); } }

#vignette { position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(120,0,0,0) 45%, rgba(150,10,0,.55) 100%); }
#vignette.flash { animation: vflash .5s ease-out; }
@keyframes vflash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ---------------- subtitles */
#subtitle { position: absolute; left: 50%; bottom: 13%; transform: translateX(-50%) translateY(10px);
  max-width: min(680px, 82vw); background: linear-gradient(180deg, rgba(6,8,12,.82), rgba(6,8,12,.7));
  border: 1px solid rgba(255,190,130,.22); border-right: 3px solid #ffb060; border-radius: 8px;
  padding: 10px 16px; direction: rtl; text-align: right; opacity: 0; transition: opacity .25s, transform .25s; }
#subtitle.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#subtitle-who { display: block; font-size: 12px; font-weight: 700; color: #ffb060; margin-bottom: 3px; letter-spacing: .2px; }
#subtitle-line { font-size: 15px; line-height: 1.55; color: #f4efe6; }

/* ---------------- boss bar */
#boss-bar { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); width: min(460px, 70vw);
  direction: rtl; text-align: center; }
#boss-name { font-size: 13px; font-weight: 900; color: #ff7a5a; letter-spacing: 1px; margin-bottom: 4px;
  text-shadow: 0 2px 8px rgba(0,0,0,.9); }
#boss-track { height: 8px; background: rgba(20,6,6,.7); border: 1px solid rgba(255,110,80,.35); border-radius: 5px; overflow: hidden; }
#boss-fill { height: 100%; width: 100%; background: linear-gradient(90deg,#ff3b1f,#ff9a5a); transition: width .2s ease; }

/* ---------------- banner / brief */
#banner { position: absolute; left: 50%; top: 26%; transform: translateX(-50%) translateY(-6px);
  font-size: clamp(20px, 3.4vw, 34px); font-weight: 900; color: #fff4e6; text-align: center; opacity: 0;
  text-shadow: 0 4px 24px rgba(0,0,0,.95), 0 0 40px rgba(255,150,80,.35); transition: opacity .4s, transform .4s;
  pointer-events: none; letter-spacing: .5px; }
#banner.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast { position: absolute; left: 50%; top: 38%; transform: translateX(-50%) translateY(-4px);
  padding: 6px 16px; border-radius: 8px; background: #101820cc; color: #f0dcb4; font-size: 15px;
  opacity: 0; transition: opacity .18s ease, transform .18s ease; pointer-events: none; z-index: 5;
  border: 1px solid #ffffff22; white-space: nowrap; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media(max-height:480px){ #toast{ top: 44%; font-size: 13px; } }
#banner.danger { color: #ffb4a0; }
#brief { position: absolute; left: 50%; bottom: 26%; transform: translateX(-50%); text-align: center;
  direction: rtl; opacity: 0; transition: opacity .5s; pointer-events: none; }
#brief.show { opacity: 1; }
#brief .brief-line1 { font-size: 13px; letter-spacing: 3px; color: #ffb060; font-weight: 700; margin-bottom: 6px; }
#brief .brief-line2 { font-size: clamp(13px, 1.8vw, 17px); color: #efe6d8; max-width: 70vw; line-height: 1.7;
  text-shadow: 0 2px 12px rgba(0,0,0,.9); }

/* ---------------- touch controls */
#touch-ui { position: absolute; inset: 0; pointer-events: none; }
#left-stick { position: absolute; left: 22px; bottom: 22px; width: 128px; height: 128px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.18); background: rgba(10,12,18,.28); }
#left-stick.active { border-color: rgba(255,190,130,.5); background: rgba(255,190,130,.08); }
#left-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: rgba(255,220,180,.28); border: 1.5px solid rgba(255,220,180,.55); }
#aim-zone { position: absolute; right: 0; top: 0; width: 46%; height: 78%; border-radius: 0 0 0 40px; }
#aim-zone.active { background: radial-gradient(circle at 70% 60%, rgba(255,180,120,.07), transparent 65%); }
#btn-fire { position: absolute; right: 26px; bottom: 30px; width: 92px; height: 92px; border-radius: 50%;
  pointer-events: auto; background: radial-gradient(circle at 40% 35%, rgba(255,140,80,.5), rgba(150,40,20,.55));
  border: 2px solid rgba(255,180,130,.6); color: #fff; font-size: 16px; font-weight: 900;
  box-shadow: 0 0 24px rgba(255,120,60,.25); }
#btn-reload, #btn-switch { position: absolute; pointer-events: auto; width: 62px; height: 62px; border-radius: 50%;
  background: rgba(10,12,18,.6); border: 1.5px solid rgba(255,190,130,.35); color: #ffcf94; font-size: 12px; font-weight: 700; }
#btn-reload { right: 128px; bottom: 96px; }
#btn-switch { right: 128px; bottom: 24px; }

/* ---------------- screens */
.screen { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; direction: rtl; padding: 24px;
  background: radial-gradient(ellipse at 50% 35%, rgba(40,22,16,.35), rgba(4,5,9,.86) 78%); }
.screen.dim { background: radial-gradient(ellipse at 50% 40%, rgba(20,12,10,.55), rgba(3,4,8,.9) 75%); }
.eyebrow { font-size: 12px; letter-spacing: 6px; color: #ffb060; font-weight: 700; margin-bottom: 10px; }
h1.title { font-size: clamp(44px, 11vw, 108px); font-weight: 900; margin: 0; line-height: .95;
  color: #fdf6ec; text-shadow: 0 8px 40px rgba(0,0,0,.8), 0 0 60px rgba(255,140,70,.22); }
.subtitle-big { font-size: clamp(15px, 2.4vw, 22px); color: #ffcf94; font-weight: 700; margin: 10px 0 0; letter-spacing: 4px; }
.blurb { font-size: clamp(13px, 1.7vw, 16px); color: #d8cfc2; max-width: 520px; line-height: 1.9; margin: 18px 0 26px; }
.btn { pointer-events: auto; cursor: pointer; border: 1px solid rgba(255,190,130,.55); color: #1a0f08;
  background: linear-gradient(180deg, #ffcf94, #f0a55c); font-family: inherit; font-weight: 900;
  font-size: 17px; padding: 13px 42px; border-radius: 10px; letter-spacing: 1px;
  box-shadow: 0 8px 28px rgba(240,150,70,.3); transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 34px rgba(240,150,70,.42); }
.btn.ghost { background: transparent; color: #ffcf94; box-shadow: none; }
.rules { display: flex; gap: 22px; margin-top: 26px; font-size: 12px; color: #b9b0a4; direction: rtl; flex-wrap: wrap; justify-content: center; }
.rules span { display: flex; align-items: center; gap: 6px; }
.kbd { display: inline-block; padding: 2px 7px; border: 1px solid rgba(255,255,255,.25); border-radius: 4px;
  font-size: 11px; color: #e8dfd2; background: rgba(255,255,255,.06); }

/* cold open */
#screen-coldopen { cursor: pointer; justify-content: flex-end; padding-bottom: 12vh; }
#coldopen-who { font-size: 13px; color: #ffb060; font-weight: 700; letter-spacing: 1px; margin-bottom: 12px; }
#coldopen-line { font-size: clamp(18px, 2.8vw, 28px); font-weight: 700; max-width: min(760px, 86vw); line-height: 1.65; }
#coldopen-count { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); font-size: 12px; color: #8d857a; }
#btn-skip { position: absolute; top: 20px; left: 20px; pointer-events: auto; background: none; border: none;
  color: #8d857a; font-family: inherit; font-size: 13px; cursor: pointer; }

/* panels */
.panel-screen { background: rgba(10,12,18,.86); border: 1px solid rgba(255,190,130,.22); border-radius: 16px;
  padding: 30px 40px;  max-width: 92vw; }
.panel-screen h2 { font-size: clamp(26px, 4vw, 40px); margin: 0 0 6px; font-weight: 900; color: #fdf6ec; }
.panel-screen .sub { color: #b9b0a4; font-size: 13px; margin-bottom: 22px; }
.stats { display: flex; gap: 26px; justify-content: center; margin: 18px 0 26px; flex-wrap: wrap; }
.grade-big { font-size: clamp(40px, 13vh, 64px); font-weight: 900; color: #ffcf94; text-shadow: 0 0 22px rgba(255, 150, 60, .55); line-height: 1; margin-top: 6px; }
.newbest { display: none; color: #ffd76a; font-size: 13px; font-weight: 700; margin-top: 4px; }
#btn-raid { margin-top: 10px; }
.raid-best { color: #b9b0a4; font-size: 12px; margin-top: 8px; }
.bests { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.bests .best { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); border-radius: 8px; padding: 6px 14px; font-size: 13px; color: #cfc7bb; }
.bests .best b { color: #ffcf94; margin-inline-start: 8px; font-size: 16px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat b { font-size: 24px; color: #ffcf94; font-weight: 900; }
.stat span { font-size: 11px; color: #9b9388; letter-spacing: 1px; }
.buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* loading */
#loading { position: fixed; inset: 0; z-index: 60; background: #05060a; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; }
#loading-text { font-size: 14px; color: #ffcf94; letter-spacing: 1px; }
#loading-track { width: min(280px, 60vw); height: 3px; background: rgba(255,255,255,.12); border-radius: 2px; overflow: hidden; }
#loading-bar { height: 100%; width: 5%; background: linear-gradient(90deg,#ffb060,#ff7a3a); transition: width .3s; }

/* orientation */
#orientation { position: fixed; inset: 0; z-index: 80; background: #05060a; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 18px; direction: rtl; text-align: center; padding: 30px; }
#orientation .phone { width: 74px; height: 128px; border: 3px solid #ffb060; border-radius: 12px;
  animation: rot 1.8s ease-in-out infinite; }
@keyframes rot { 0%,40% { transform: rotate(0deg); } 70%,100% { transform: rotate(-90deg); } }
#orientation p { font-size: 16px; color: #efe6d8; line-height: 1.8; }

@media (max-width: 560px) {
  #objective { font-size: 11px; max-width: 40vw; }
  #health-bar { width: 110px; }
  #ammo-num { font-size: 20px; }
  #subtitle-line { font-size: 13px; }
  #btn-fire { width: 80px; height: 80px; }
}

#banner { top: 12%; font-size: 25px; }
#brief { top: 23%; bottom: auto; max-width: 55vw; opacity: .9; }

.touch-hints { display:none; font-size:12px; line-height:1.8; margin-top:12px; color:#ded1bd; }
body.touch .desktop-hints { display:none; }
body.touch .touch-hints { display:block; }
#btn-sprint {position:absolute;bottom:110px;left:145px;pointer-events:auto;border:1px solid #aa9474;border-radius:50%;width:54px;height:54px;background:#17191aaa;color:#ffcf94;font:700 13px Cairo;}
@media(max-height:480px){
#screen-title {padding:12px 30px;}
h1.title {font-size:clamp(32px,12vh,58px);line-height:1.35;max-width:92%;overflow:visible;}
.eyebrow {font-size:10px;margin-bottom:0;}
.subtitle-big {font-size:16px;margin:0;}
.blurb {font-size:12px;line-height:1.6;margin:6px 0 10px;}
#btn-start {font-size:15px;padding:9px 30px;}
.rules {margin-top:10px;gap:12px;}
}

@media(max-height:480px){#brief{top:14px;bottom:auto;max-width:42vw;}#brief .brief-line1{font-size:10px;}#brief .brief-line2{font-size:11px;line-height:1.4;}#banner{top:20%;}}

#world-clock{position:absolute;top:15px;left:50%;transform:translateX(-50%);font-size:13px;color:#e2cfaa;background:#121b21aa;padding:3px 10px;border-radius:5px;}#stamina{position:absolute;bottom:18px;left:50%;transform:translateX(-50%);width:90px;height:4px;background:#ffffff22;}#stamina-fill{height:100%;width:100%;background:#eac18a;}.world-options{display:flex;gap:6px;flex-wrap:wrap;justify-content:center;margin:10px 0;}.world-options button{background:#27323b;color:#ece2d1;border:1px solid #5f6263;padding:8px;font-family:inherit;border-radius:6px;}

#world-clock{top:52px;}@media(max-height:480px){#brief{top:72px;max-width:42vw;}#brief .brief-line2{display:none;}}

#settings-v9{display:grid;grid-template-columns:1fr 1fr;gap:6px 16px;max-height:32vh;overflow:auto;margin-top:10px;font-size:11px;}#settings-v9 label{display:flex;align-items:center;justify-content:space-between;gap:8px;}#settings-v9 input[type=range]{width:90px;}.panel-screen{max-height:96vh;overflow:auto;}
#screen-pause{padding:8px;}#screen-pause .panel-screen{padding:14px 24px;}#settings-v9{touch-action:pan-y;}#settings-v9 input{touch-action:auto;}body.touch #game{touch-action:none;}
@media(max-height:420px){#screen-pause h2{font-size:24px;}#screen-pause .btn{font-size:13px;padding:7px 22px;}#screen-pause .sub{margin-bottom:6px;}#settings-v9{max-height:35vh;}.world-options button{padding:5px;font-size:11px;}}
/* v11 touch hierarchy: one fire target, neutral secondary actions. */
#touch-ui button{background:radial-gradient(circle at 35% 25%,#d8e5f51a,#12192352 80%)!important;border:1px solid #e7f1ff80!important;box-shadow:inset 0 0 0 3px #0a101820,0 3px 12px #0003!important;color:#f4f7fb!important;backdrop-filter:blur(2px);border-radius:50%;padding:14px;touch-action:none;}
#touch-ui button svg{width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 2px 2px #0008);pointer-events:none;}
#touch-ui button:active,#touch-ui button.selected{background:#b6cddd55!important;border-color:#fff!important;}
#btn-fire{right:26px;bottom:33px;width:82px;height:82px;padding:20px!important;border-width:2px!important;}
#btn-reload{right:120px;bottom:37px;width:53px;height:53px;padding:12px!important;}
#btn-switch{right:183px;bottom:30px;width:48px;height:48px;padding:10px!important;}
#btn-sprint{left:143px;bottom:105px;width:48px;height:48px;padding:10px!important;}
#btn-aim{position:absolute;right:39px;bottom:134px;width:52px;height:52px;pointer-events:auto;padding:11px!important;}
#left-stick{width:122px;height:122px;left:27px;bottom:28px;border:1px solid #dce7f83d;background:radial-gradient(circle,#ccd9e511,#111b2b33 70%);box-shadow:inset 0 0 0 18px #ffffff06;}
#left-knob{width:48px;height:48px;margin:-24px 0 0 -24px;border:1px solid #e7f1ff80;background:radial-gradient(circle at 30% 25%,#e7eef14a,#899bbd2b);box-shadow:0 4px 14px #0004;}
#left-stick:before,#left-stick:after{content:'';position:absolute;background:#dbeaff28;left:calc(50% - 3px);width:6px;height:2px;top:9px;}#left-stick:after{top:auto;bottom:9px;}
#quality-panel{margin-top:12px;color:#d4dde5;font-size:12px}#quality-panel select{background:#25313b;color:#fff;border:1px solid #677580;padding:7px;border-radius:5px;margin:4px}#quality-panel p{max-width:430px;font-size:11px;line-height:1.6}

#screen-pause .panel-screen{touch-action:pan-y;overscroll-behavior:contain;}

/* ---- HUD lanes: each element owns a fixed band so nothing can overlap ---- */
#world-clock{ top: 12px !important; }
#brief{ top: 50px !important; bottom: auto !important; left: 50% !important; transform: translateX(-50%) !important; max-width: 58vw !important; }
#banner{ top: 100px !important; }
#toast{ top: 214px !important; }
@media(max-height:420px){
  #brief{ top: 46px !important; }
  #banner{ top: 86px !important; }
  #toast{ top: 190px !important; }
}
