/* =========================================================
   الأسطول البحري | تنسيقات شاشة المقدّم وجوال الفريق
   الهوية المشتركة في ../assets/athar.css
   وفوقها هوية اللعبة: غرفة عمليات بحرية، خريطة ملاحية ورادار،
   فيروزي للماء، برتقالي لهب للإصابة، أحمر للفخ، أصفر طوق النجاة للسبّاحين
   ========================================================= */

/* ---------- ثيم إضافي خاص باللعبة: غرفة العمليات ---------- */
[data-theme="ops"]{
  --bg:#04142B;
  --bg-paint:
    radial-gradient(900px 560px at 50% -10%, rgba(34,184,207,.20), transparent 62%),
    radial-gradient(700px 480px at 100% 110%, rgba(30,111,224,.22), transparent 60%),
    #04142B;
  --text:#E6F6FF;
  --text-2:#9FD8EC;
  --accent:#22D3EE;
  --accent-hover:#67E8F9;
  --on-accent:#04142B;
  --hl:#22D3EE;
  --hl-2:#5CC2F5;
  --surface:rgba(34,211,238,.06);
  --surface-2:rgba(34,211,238,.13);
  --solid:#0A2140;
  --line:rgba(103,232,249,.20);
  --cell:rgba(34,211,238,.10);
  --cell-label:rgba(159,216,236,.55);
  --shadow:0 10px 30px rgba(0,0,0,.4);
  --scrim:rgba(1,8,20,.78);
}
[data-theme="ops"] .logo-main{display:none;}
[data-theme="ops"] .logo-rev{display:block;}
.theme-dot[data-set-theme="ops"]{background:radial-gradient(circle at 50% 50%,#22D3EE 0 22%,#04142B 24% 100%);}

/* ---------- ألوان اللعبة لكل ثيم ---------- */
:root,[data-theme="light"]{
  --water:#D6ECFC; --water-2:#C3E2FA; --wave:rgba(30,111,224,.16); --chart:rgba(10,36,99,.035);
  --miss:#22B8CF; --miss-bg:#E6F8FB;
  --hull-S:#2B3650; --hull-W:#4B5B76; --hull-B:#7D8CA6; --hull-line:rgba(10,36,99,.25);
  --frame:#FFFFFF; --frame-line:rgba(10,36,99,.14);
}
[data-theme="navy"]{
  --water:rgba(92,194,245,.13); --water-2:rgba(92,194,245,.07); --wave:rgba(191,227,252,.14); --chart:rgba(220,238,254,.035);
  --miss:#5EE3F2; --miss-bg:rgba(34,184,207,.16);
  --hull-S:#8FA3BF; --hull-W:#A9BAD1; --hull-B:#C4D2E4; --hull-line:rgba(255,255,255,.35);
  --frame:#0F2F7A; --frame-line:rgba(220,238,254,.18);
}
[data-theme="blue"]{
  --water:rgba(255,255,255,.20); --water-2:rgba(255,255,255,.12); --wave:rgba(255,255,255,.22); --chart:rgba(255,255,255,.04);
  --miss:#E0FBFF; --miss-bg:rgba(10,36,99,.20);
  --hull-S:#0A2463; --hull-W:#163A86; --hull-B:#2552A8; --hull-line:rgba(255,255,255,.45);
  --frame:rgba(255,255,255,.14); --frame-line:rgba(255,255,255,.3);
}
[data-theme="ops"]{
  --water:#0B2848; --water-2:#08203C; --wave:rgba(34,211,238,.16); --chart:rgba(34,211,238,.035);
  --miss:#22D3EE; --miss-bg:rgba(34,211,238,.12);
  --hull-S:#7F93AD; --hull-W:#9AACC4; --hull-B:#B7C6D9; --hull-line:rgba(103,232,249,.45);
  --frame:#071B35; --frame-line:rgba(103,232,249,.25);
}
body{
  --fire:#F97316; --fire-dk:#C2410C; --trap:#EF4444; --trap-dk:#B91C1C; --gold:#FACC15; --gold-ink:#3A2A00;
  --sunk:#7C2D12; --ok:#1FA971; --bad:#E8554E;
}

/* ---------- أساسيات ---------- */
*{box-sizing:border-box; margin:0; padding:0;}
html{-webkit-text-size-adjust:100%; background:var(--bg); overflow-x:clip;}
body{
  min-height:100vh; min-height:100dvh;
  background:transparent; /* الخلفية في طبقة .sea حتى تظهر الصورة والنقش */
  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:clip;
}
h1,h2,h3,h4,strong,b{font-weight:700;}
button,input{font:inherit; color:inherit;}
button{cursor:pointer; -webkit-tap-highlight-color:transparent; touch-action:manipulation; background:none; border:0;}
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;}
.center{text-align:center;}
#prepNote{margin-top:12px;}
.ico{width:1.2em; height:1.2em; fill:currentColor; flex:none; vertical-align:-.22em;}

/* ---------- الخلفية: خريطة ملاحية بخطوط إحداثيات وأعماق ونقش مائي ---------- */
.sea{position:fixed; inset:0; z-index:-1; pointer-events:none; overflow:hidden; background:var(--bg-paint);}
/* صورة الأسطول في الضباب: شفافة وتذوب في لون الثيم */
.sea-photo{
  position:absolute; inset:0;
  background:url("img/bg.webp") center 38% / cover no-repeat;
  opacity:var(--photo-op,.16); filter:saturate(var(--photo-sat,.9));
  -webkit-mask:linear-gradient(180deg, rgba(0,0,0,.35) 0%, #000 30%, #000 70%, rgba(0,0,0,.25) 100%);
          mask:linear-gradient(180deg, rgba(0,0,0,.35) 0%, #000 30%, #000 70%, rgba(0,0,0,.25) 100%);
}
[data-theme="light"] .sea-photo{--photo-op:.17;}
[data-theme="navy"] .sea-photo{--photo-op:.26; mix-blend-mode:luminosity;}
[data-theme="blue"] .sea-photo{--photo-op:.22; mix-blend-mode:soft-light; --photo-sat:1;}
[data-theme="ops"] .sea-photo{--photo-op:.32; --photo-sat:1.1;}
.sea::before{
  content:""; position:absolute; inset:0;
  background:
    repeating-linear-gradient(0deg, var(--chart) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, var(--chart) 0 1px, transparent 1px 64px),
    repeating-radial-gradient(circle at 12% 88%, transparent 0 34px, var(--chart) 35px 36px, transparent 37px 70px),
    repeating-radial-gradient(circle at 92% 8%, transparent 0 40px, var(--chart) 41px 42px, transparent 43px 82px);
}
.sea::after{
  content:""; position:absolute; inset:0;
  background:var(--text); opacity:.035;
  -webkit-mask:url("img/pattern.svg") 0 0 / 260px 260px repeat;
          mask:url("img/pattern.svg") 0 0 / 260px 260px repeat;
}

/* ---------- الشريط العلوي ---------- */
.topbar{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px clamp(12px,3vw,28px); border-bottom:1px solid var(--line);
  backdrop-filter:blur(6px);
}
.brand{display:flex; align-items:center; gap:10px; min-width:0; text-decoration:none; color:inherit;}
.brand .logo{height:46px; width:auto; flex:none;}
.brand-text{display:flex; flex-direction:column; min-width:0; line-height:1.35;}
.brand-text strong{font-size:1.1rem; 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;}
.theme-switch{gap:5px; padding:4px;}
.theme-dot{width:28px; height:28px;}

.icon-btn{
  width:42px; height:42px; border-radius:50%;
  display:grid; place-items:center; flex:none;
  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 .ico{width:20px; height:20px;}

.net{
  display:flex; align-items:center; gap:6px;
  padding:4px 10px; border-radius:999px;
  background:var(--surface); border:1px solid var(--line);
  font-size:.78rem; white-space:nowrap;
}
.net i{width:9px; height:9px; border-radius:50%; background:var(--bad); flex:none; position:relative;}
.net[data-on="true"] i{background:var(--ok);}
.net[data-on="true"] i::after{content:""; position:absolute; inset:0; border-radius:50%; background:var(--ok); animation:live 1.5s ease-out infinite;}
@keyframes live{0%{transform:scale(1); opacity:.8;} 100%{transform:scale(2.8); opacity:0;}}
.net b{font-weight:500;}

/* أشرطة الصوت المتمايلة */
.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);}

/* ---------- الأزرار (مجسّمة بظل سفلي) ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  min-height:48px; padding:10px 20px;
  border-radius:14px; border:1px solid var(--line);
  background:var(--solid); color:var(--text);
  font-weight:700; font-size:1rem;
  box-shadow:0 4px 0 var(--line);
  transition:transform .12s ease, box-shadow .12s ease, background .2s ease, opacity .2s;
}
.btn:hover{background:var(--surface-2);}
.btn:active{transform:translateY(3px); box-shadow:0 1px 0 var(--line);}
.btn:disabled{opacity:.45; cursor:not-allowed; transform:none; box-shadow:0 4px 0 var(--line);}
.btn-primary{background:var(--accent); color:var(--on-accent); border-color:transparent; box-shadow:0 5px 0 #0A2463;}
[data-theme="navy"] .btn-primary,[data-theme="blue"] .btn-primary{box-shadow:0 5px 0 rgba(3,12,38,.55);}
[data-theme="ops"] .btn-primary{box-shadow:0 5px 0 #0E7490;}
.btn-primary:hover{background:var(--accent-hover);}
.btn-primary:active{box-shadow:0 2px 0 #0A2463;}
.btn-danger{background:var(--trap) !important; color:#fff !important; box-shadow:0 5px 0 var(--trap-dk) !important;}
.btn-big{width:100%; min-height:58px; font-size:1.15rem; border-radius:18px;}
.btn-small{min-height:40px; padding:6px 14px; font-size:.9rem; border-radius:12px; box-shadow:0 3px 0 var(--line);}
.btn-ghost{background:transparent; border-color:transparent; color:var(--text-2); box-shadow:none;}
.btn-ghost:active{box-shadow:none;}
.btn .ico{width:1.15em; height:1.15em;}
.btn.pulse{animation:btnPulse 1.6s ease-in-out infinite;}
@keyframes btnPulse{50%{box-shadow:0 5px 0 #0A2463, 0 0 0 8px rgba(92,194,245,.28);}}

/* ---------- الشاشات ---------- */
main{flex:1; padding:clamp(12px,3vw,26px); display:flex; flex-direction:column;}
.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:640px; margin:0 auto; width:100%;}
.setup.wide{max-width:860px;}
.setup.wider{max-width:1180px;}
.setup-hero{text-align:center; margin-bottom:18px;}
.setup-hero h1{font-size:clamp(2.1rem,8vw,3.4rem); line-height:1.3; letter-spacing:-.01em;}
.lead{color:var(--text-2); font-size:clamp(1rem,2.4vw,1.12rem); max-width:46ch; margin:4px auto 0;}
.step-head{text-align:center; margin-bottom:16px;}
.step-head h2{font-size:clamp(1.5rem,4.5vw,2rem);}

.card{
  background:var(--surface); border:1px solid var(--line); border-radius:20px;
  padding:18px; margin-bottom:14px; box-shadow:var(--shadow);
  backdrop-filter:blur(4px);
}
.card-head{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; flex-wrap:wrap;}
.card-head h2,.card-head h3{font-size:1.12rem;}
.actions{display:flex; gap:10px; justify-content:space-between; margin-top:6px;}
.actions .btn{flex:1;}
.actions .btn-primary{flex:2;}
.home-link{display:block; width:max-content; max-width:100%; margin:10px auto 0; color:var(--text-2); font-weight:700; text-decoration:none; padding:6px 10px; border-radius:10px; font-size:.95rem;}
.home-link:hover{background:var(--surface);}

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

/* ---------- صورة البطل: رادار يمسح ---------- */
.hero-radar{position:relative; width:clamp(150px,30vw,210px); margin:0 auto 4px; filter:drop-shadow(0 18px 30px rgba(10,36,99,.28));}
.hero-radar.small{width:clamp(120px,34vw,160px);}
.hero-radar svg{display:block; width:100%; height:auto;}
.hero-radar .sweep{transform-origin:110px 110px; animation:sweep 4s linear infinite;}
@keyframes sweep{to{transform:rotate(360deg);}}
.hero-radar .blip{animation:blip 4s linear infinite;}
.hero-radar .b1{animation-delay:-3.55s;}
.hero-radar .b2{animation-delay:-1.4s;}
.hero-radar .b3{animation-delay:-2.2s;}
@keyframes blip{0%{opacity:1;} 60%{opacity:.25;} 100%{opacity:1;}}
.hero-radar .ping{fill:none; stroke:#8FD0FA; stroke-width:2; transform-box:fill-box; transform-origin:center; animation:ping 2s ease-out infinite;}
.hero-radar .b2 .ping{stroke:#F97316; animation-delay:-.8s;}
@keyframes ping{0%{transform:scale(.4); opacity:.9;} 100%{transform:scale(1.6); opacity:0;}}
.hero-sea{
  position:absolute; inset-inline:-18%; bottom:-6px; height:16px;
  background:var(--hl);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 12'%3E%3Cpath d='M0 6c5 0 5-4 10-4s5 4 10 4 5-4 10-4 5 4 10 4' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") 0 50% / 40px 14px repeat-x; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 12'%3E%3Cpath d='M0 6c5 0 5-4 10-4s5 4 10 4 5-4 10-4 5 4 10 4' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") 0 50% / 40px 14px repeat-x;
  opacity:.6; animation:waves 2.6s linear infinite;
}
@keyframes waves{to{-webkit-mask-position:40px 50%; mask-position:40px 50%;}}

/* ---------- الوحدات ---------- */
.units{display:grid; grid-template-columns:repeat(5,1fr); gap:8px; margin-bottom:14px;}
.unit{
  display:flex; flex-direction:column; align-items:center; text-align:center; gap:1px;
  padding:12px 6px 10px; border-radius:16px;
  background:var(--solid); border:1px solid var(--line); box-shadow:0 4px 0 var(--line);
}
.unit .u-ico{width:44px; height:44px; border-radius:12px; display:grid; place-items:center; margin-bottom:4px; color:#fff; background:var(--hull-W);}
.unit .u-ico .ico{width:28px; height:28px;}
.u-S .u-ico{background:var(--hull-S);} .u-B .u-ico{background:var(--hull-B);}
.u-sw .u-ico{background:var(--gold); color:var(--gold-ink);}
.u-tr .u-ico{background:var(--trap);}
.unit strong{font-size:1rem;}
.unit small{color:var(--text-2); font-size:.72rem; line-height:1.5;}
.u-pts{margin-top:4px; font-size:.76rem; padding:1px 8px; border-radius:999px; background:var(--surface-2); color:var(--text);}
.u-pts.neg{background:rgba(239,68,68,.14); color:var(--trap);}
[data-theme="navy"] .u-pts.neg,[data-theme="blue"] .u-pts.neg,[data-theme="ops"] .u-pts.neg{color:#FFB4B4;}

.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);}

/* ---------- الإعداد ---------- */
.seg{display:flex; gap:6px; padding:5px; background:var(--solid); border:1px solid var(--line); border-radius:16px; margin-bottom:12px;}
.seg button{flex:1; min-height:44px; border-radius:12px; font-weight:700; font-size:1.05rem; color:var(--text-2); transition:background .2s, color .2s, transform .15s;}
.seg button[aria-pressed="true"]{background:var(--accent); color:var(--on-accent); box-shadow:0 3px 0 rgba(10,36,99,.35);}
.names{display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:8px;}
.name-field{display:flex; align-items:center; gap:8px; padding:4px 12px; border-radius:14px; background:var(--solid); border:2px solid var(--line); border-inline-start:6px solid var(--tc);}
.name-field input{flex:1; min-width:0; border:0; background:transparent; min-height:42px; font-weight:700; outline:none;}
.name-field:focus-within{border-color:var(--tc);}
.dot{display:inline-block; width:12px; height:12px; border-radius:50%; background:var(--tc,var(--accent)); flex:none; box-shadow:0 0 0 2px rgba(255,255,255,.6);}

.modes{display:grid; grid-template-columns:repeat(3,1fr); gap:10px;}
.modes.two{grid-template-columns:1fr 1fr;}
.mode{
  text-align:start; padding:14px; border-radius:18px;
  background:var(--solid); border:2px solid var(--line);
  display:flex; flex-direction:column; gap:3px;
  box-shadow:0 4px 0 var(--line);
  transition:transform .15s ease, border-color .2s, background .2s;
}
.mode:hover{transform:translateY(-2px);}
.mode:disabled{opacity:.45; cursor:not-allowed;}
.mode strong{font-size:1.02rem;}
.mode span{color:var(--text-2); font-size:.84rem; line-height:1.6;}
.mode[aria-pressed="true"]{border-color:var(--accent); background:var(--surface-2); box-shadow:0 4px 0 var(--accent);}
.mode[aria-pressed="true"] strong::before{content:""; display:inline-block; width:.62em; height:.62em; border-radius:50%; background:var(--accent); margin-inline-end:.45em;}
.mode-art{display:flex !important; align-items:center; gap:8px; height:46px; margin-bottom:6px;}
.mode-art i{display:block; position:relative;}
.d-screen{width:52px; height:34px; border-radius:6px; border:3px solid var(--text); background:var(--water);}
.d-screen::after{content:""; position:absolute; left:50%; bottom:-9px; width:18px; height:4px; margin-left:-9px; border-radius:2px; background:var(--text);}
.d-phone{width:22px; height:38px; border-radius:6px; border:3px solid var(--text); background:var(--water);}
.d-arrow{width:20px; height:3px; background:var(--text-2); border-radius:2px;}
.d-arrow::after{content:""; position:absolute; left:-2px; top:-4px; border:5.5px solid transparent; border-right:7px solid var(--text-2); border-left:0;}
.d-bolt{width:16px; height:22px; background:var(--fire); clip-path:polygon(60% 0,0 58%,45% 58%,35% 100%,100% 40%,55% 40%);}

/* بيانات الأسطول */
.cfg-badge{font-size:.78rem; padding:2px 12px; border-radius:999px; background:var(--surface-2); color:var(--text-2); font-weight:700;}
.cfg-badge.mod{background:var(--gold); color:var(--gold-ink);}
.cfg-sum{display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px;}
.cfg-sum span{font-size:.82rem; padding:3px 10px; border-radius:10px; background:var(--solid); border:1px solid var(--line);}
.cfg-acts{display:flex; gap:8px; flex-wrap:wrap;}
.cfg-panel{margin-top:12px; padding-top:12px; border-top:1px dashed var(--line); animation:screenIn .3s ease both;}
.cfg-rows{display:flex; flex-direction:column; gap:8px;}
.cfg-row{display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:8px 10px; border-radius:14px; background:var(--solid); border:1px solid var(--line);}
.cfg-unit{display:flex; align-items:center; gap:6px; min-width:130px; flex:1;}
.cfg-unit .ico{width:24px; height:24px; color:var(--hull-W);}
.r-S .cfg-unit .ico{color:var(--hull-S);} .r-B .cfg-unit .ico{color:var(--hull-B);}
.r-sw .cfg-unit .ico{color:#CA8A04;} .r-tr .cfg-unit .ico{color:var(--trap);}
.mini{display:flex; flex-direction:column; align-items:center; gap:2px;}
.mini small{font-size:.7rem; color:var(--text-2);}
.mini-ctl{display:flex; align-items:center; gap:2px; padding:3px; border-radius:12px; background:var(--surface); border:1px solid var(--line);}
.mini-ctl button{width:32px; height:32px; border-radius:9px; font-weight:700; font-size:1.15rem; line-height:1; background:var(--accent); color:var(--on-accent);}
.mini-ctl button:active{transform:scale(.92);}
.mini-ctl button:disabled{opacity:.3; cursor:not-allowed;}
.mini-ctl output{min-width:4.2ch; text-align:center; font-weight:700;}
.cfg-note{margin-top:8px; font-size:.84rem; color:var(--text-2);}
.cfg-note.bad{color:var(--trap); font-weight:700;}
[data-theme="navy"] .cfg-note.bad,[data-theme="blue"] .cfg-note.bad,[data-theme="ops"] .cfg-note.bad{color:#FFB4B4;}

/* ---------- تجهيز الأساطيل ---------- */
.joinhint{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;}
.joinhint > div{display:flex; flex-wrap:wrap; align-items:baseline; gap:6px;}
.join-url{font-size:1.05rem; direction:ltr; unicode-bidi:isolate; color:var(--text); word-break:break-all;}
.prep-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:12px; margin-bottom:14px;}
.tcard{
  background:var(--solid); border:2px solid var(--line); border-top:6px solid var(--tc);
  border-radius:20px; padding:14px; box-shadow:0 5px 0 var(--line);
  display:flex; flex-direction:column; gap:12px;
}
.tcard.ready{border-color:var(--tc); box-shadow:0 5px 0 var(--tc);}
.tcard header{display:flex; align-items:center; gap:8px;}
.tcard header strong{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:1.08rem;}
.st{font-size:.76rem; padding:2px 10px; border-radius:999px; background:var(--surface-2); color:var(--text-2); white-space:nowrap;}
.st.on{background:rgba(92,194,245,.2); color:var(--text);}
.st.ok{background:var(--ok); color:#fff;}
.tjoin{display:flex; gap:12px; align-items:center;}
.tjoin > div:last-child{display:flex; flex-direction:column; align-items:flex-start; gap:2px; min-width:0;}
.qr{width:104px; height:104px; flex:none; background:#fff; border-radius:12px; padding:5px;}
.qr svg{width:100%; height:100%; display:block;}
.tcode{font-size:1.3rem; letter-spacing:.06em; white-space:nowrap; direction:ltr; unicode-bidi:isolate; line-height:1.3;}
.tacts{display:grid; grid-template-columns:1fr 1fr; gap:8px;}
.tacts .btn{padding:6px 8px; font-size:.86rem;}

/* =========================================================
   المعركة
   ========================================================= */
.battle{display:grid; grid-template-columns:minmax(0,1fr) 370px; gap:18px; max-width:1500px; margin:0 auto; width:100%; align-items:start;}
.arena{min-width:0;}
.pick{display:flex; align-items:center; gap:10px; margin-bottom:10px;}
.pick-l{font-weight:700; font-size:.85rem; color:var(--text-2); flex:none; width:58px;}
.chips,.tabs{display:flex; gap:7px; overflow-x:auto; padding:3px 2px 7px; scrollbar-width:thin; flex:1; min-width:0;}
.chip,.tab{
  display:inline-flex; align-items:center; gap:7px; flex:none;
  min-height:42px; padding:5px 12px; border-radius:999px;
  background:var(--solid); border:2px solid var(--line); box-shadow:0 3px 0 var(--line);
  font-weight:700; font-size:.92rem; white-space:nowrap;
  transition:transform .12s, border-color .2s, background .2s;
}
.chip:active,.tab:active{transform:translateY(2px); box-shadow:0 1px 0 var(--line);}
.chip.on,.tab.on{border-color:var(--tc); background:color-mix(in srgb, var(--tc) 16%, var(--solid)); box-shadow:0 3px 0 var(--tc);}
.chip.empty .strk{opacity:.5;}
.strk{display:inline-flex; align-items:center; gap:2px; padding:0 8px 0 6px; border-radius:999px; background:var(--gold); color:var(--gold-ink); font-size:.86rem;}
.strk .ico{width:.95em; height:.95em;}
.tab small{color:var(--text-2); font-weight:500; font-size:.74rem;}

/* إطار الرادار */
.radar-frame{
  --tc:var(--accent);
  position:relative; padding:12px 12px 14px; border-radius:24px;
  background:var(--frame); border:1px solid var(--frame-line);
  box-shadow:0 0 0 4px color-mix(in srgb, var(--tc) 22%, transparent), var(--shadow);
}
.radar-frame::before,.radar-frame::after{ /* زوايا تصويب */
  content:""; position:absolute; width:26px; height:26px; border:3px solid var(--tc); pointer-events:none; opacity:.85;
}
.radar-frame::before{top:-3px; inset-inline-start:-3px; border-bottom:0; border-inline-end:0; border-start-start-radius:24px;}
.radar-frame::after{bottom:-3px; inset-inline-end:-3px; border-top:0; border-inline-start:0; border-end-end-radius:24px;}
.frame-head{display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 4px 8px; flex-wrap:wrap;}
.live{display:inline-flex; align-items:center; gap:8px; font-size:1.05rem;}
.live i{width:10px; height:10px; border-radius:50%; background:var(--tc); position:relative;}
.live i::after{content:""; position:absolute; inset:0; border-radius:50%; background:var(--tc); animation:live 1.6s ease-out infinite;}
.frame-stat{font-size:.8rem; color:var(--text-2);}
.board-wrap{position:relative; margin:0 auto; width:100%;}
.host .arena .board-wrap{max-width:min(820px, calc((100dvh - 400px) * 1.06)); min-width:300px;}

/* مسح رادار خفيف فوق اللوح */
.radar-frame .board-wrap::after{
  content:""; position:absolute; inset:0; pointer-events:none; border-radius:14px; overflow:hidden;
  background:conic-gradient(from 0deg at 54% 54%, color-mix(in srgb, var(--hl) 28%, transparent) 0deg, transparent 50deg 360deg);
  -webkit-mask:radial-gradient(circle at 54% 54%, #000 0 70%, transparent 71%);
          mask:radial-gradient(circle at 54% 54%, #000 0 70%, transparent 71%);
  animation:sweep 6s linear infinite; opacity:.4; mix-blend-mode:multiply;
}
[data-theme="navy"] .radar-frame .board-wrap::after,[data-theme="blue"] .radar-frame .board-wrap::after,[data-theme="ops"] .radar-frame .board-wrap::after{mix-blend-mode:screen;}
.radar-frame.own .board-wrap::after{display:none;}

/* ---------- اللوح ١٠×١٠ ---------- */
.board{
  container-type:inline-size;
  display:grid; grid-template-columns:1.5em repeat(10,minmax(0,1fr)); gap:clamp(2px,.55cqi,5px);
  width:100%; user-select:none; -webkit-user-select:none;
}
.board .corner{display:block;}
.board .lbl{display:grid; place-items:center; font-weight:700; color:var(--cell-label); font-size:clamp(.66rem,2.3cqi,1rem); line-height:1;}
.board .lbl.col{padding-bottom:2px;}
.cell{
  position:relative; aspect-ratio:1; min-height:0; border-radius:clamp(4px,1.2cqi,10px);
  background:var(--water); border:1px solid var(--frame-line);
  display:grid; place-items:center; overflow:visible;
  font-size:clamp(8px,2.2cqi,17px); color:var(--text);
  transition:transform .15s ease, background .2s ease, box-shadow .2s;
}
.cell:disabled{cursor:default;}
.cell > .ico{position:absolute; inset:0; margin:auto; width:62%; height:62%;}
/* المجهول: ماء بموجة خفيفة */
.cell.fog{background:linear-gradient(160deg, var(--water), var(--water-2)); cursor:crosshair;}
.cell.fog::before{ /* موجة صغيرة */
  content:""; position:absolute; inset:58% 18% 22%; background:var(--wave);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 12'%3E%3Cpath d='M0 6c5 0 5-4 10-4s5 4 10 4 5-4 10-4 5 4 10 4' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 12'%3E%3Cpath d='M0 6c5 0 5-4 10-4s5 4 10 4 5-4 10-4 5 4 10 4' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.cell.fog:nth-child(3n)::before{inset:30% 26% 50% 14%;}
.cell.fog:nth-child(4n+1)::before{opacity:.6;}
.cell.fog:not(:disabled):hover{transform:scale(1.07); box-shadow:0 0 0 2px var(--hl); z-index:2;}
.cell.miss{background:var(--miss-bg); color:var(--miss); border-color:color-mix(in srgb, var(--miss) 45%, transparent);}
.cell.miss .mark{width:55%; height:55%; opacity:.9;}
.cell.hit{background:var(--fire); color:#fff; border-color:var(--fire-dk); box-shadow:inset 0 -3px 0 var(--fire-dk);}
.cell.trap{background:var(--trap); color:#fff; border-color:var(--trap-dk); box-shadow:inset 0 -3px 0 var(--trap-dk);}
.cell .mark{width:62%; height:62%;}
.cell.hit .mark{opacity:.95;}
.cell .burst{width:42%; height:42%; inset:auto; margin:0; top:-12%; inset-inline-end:-12%; fill:var(--gold); filter:drop-shadow(0 1px 1px rgba(0,0,0,.35));}
.cell.trap .burst{width:56%; height:56%; inset:0; margin:auto; fill:#fff; filter:none;}
.cell.hit:not(.hull):not(.hit-S):not(.hit-W):not(.hit-B) .burst{width:60%; height:60%; inset:0; margin:auto; fill:#fff; filter:none;}

/* أجزاء القطع (الأسطول الظاهر) */
.cell.hull{background:var(--hull-W); border-color:var(--hull-line); color:#fff; border-radius:3px;}
.cell.hull-S{background:var(--hull-S);} .cell.hull-B{background:var(--hull-B);}
[data-theme="navy"] .cell.hull,[data-theme="ops"] .cell.hull{color:#0A2463;}
.cell.hull.h.p0{border-start-start-radius:4.2cqi; border-end-start-radius:4.2cqi;}
.cell.hull.h.p9{border-start-end-radius:2.4cqi; border-end-end-radius:2.4cqi;}
.cell.hull.v.p0{border-start-start-radius:4.2cqi; border-start-end-radius:4.2cqi;}
.cell.hull.v.p9{border-end-start-radius:2.4cqi; border-end-end-radius:2.4cqi;}
.cell .ship-ico{width:74%; height:74%; z-index:1;}
/* القطعة الغارقة: محترقة */
.cell.sunk{background:var(--sunk) !important; color:#FED7AA !important; border-color:#431407 !important; box-shadow:inset 0 0 0 2px rgba(249,115,22,.55);}
.cell.sunk .burst{fill:#FDBA74;}
/* المربعات المقصوفة على أسطولنا */
.cell.hull.shot.hit,.cell.hull.shot.trap{background:var(--fire);}
.cell.hull.shot.trap{background:var(--trap);}
.cell.shot.miss{background:var(--miss-bg);}

/* شارات التجميع */
.badge{
  position:absolute; inset-block-end:-8%; inset-inline-start:-6%; z-index:3;
  display:inline-flex; align-items:center; gap:1px;
  padding:0 .35em 0 .25em; border-radius:999px; line-height:1.45;
  font-size:max(9px,.82em); font-weight:700; white-space:nowrap;
  box-shadow:0 1px 2px rgba(0,0,0,.3);
}
.badge .ico{width:1.05em; height:1.05em;}
.b-sw{background:var(--gold); color:var(--gold-ink);}
.b-tr{background:#fff; color:var(--trap); inset-inline-start:auto; inset-inline-end:-6%; inset-block-end:auto; inset-block-start:-8%;}
.cell.trap .b-tr{display:none;}

/* المعاينة والتصويب */
.cell.ghost{box-shadow:inset 0 0 0 3px var(--accent); background:color-mix(in srgb, var(--accent) 30%, var(--water));}
.cell.ghost.bad{box-shadow:inset 0 0 0 3px var(--trap); background:color-mix(in srgb, var(--trap) 25%, var(--water));}
.cell.aim{box-shadow:0 0 0 3px var(--fire), 0 0 18px rgba(249,115,22,.6); z-index:3; transform:scale(1.06);}
.cell .reticle{width:88%; height:88%; fill:var(--fire); animation:reticle 1.1s ease-in-out infinite;}
@keyframes reticle{50%{transform:scale(.82) rotate(45deg);}}
.cell.pending{animation:pend .7s ease-in-out infinite; box-shadow:0 0 0 3px var(--gold);}
@keyframes pend{50%{background:var(--gold);}}

/* حركات نتيجة الضربة */
.cell.flash-hit,.cell.flash-trap{animation:boom .7s ease-out; z-index:4;}
@keyframes boom{0%{transform:scale(.5); box-shadow:0 0 0 0 rgba(250,204,21,.9);} 45%{transform:scale(1.3); box-shadow:0 0 30px 16px rgba(249,115,22,.75);} 100%{transform:scale(1);}}
.cell.flash-miss{animation:splash .8s ease-out; z-index:4;}
.cell.flash-miss::after{content:""; position:absolute; inset:-30%; border-radius:50%; border:3px solid var(--miss); animation:ripple .8s ease-out both; pointer-events:none;}
@keyframes splash{0%{transform:scale(.7);} 50%{transform:scale(1.12);} 100%{transform:scale(1);}}
@keyframes ripple{from{transform:scale(.3); opacity:1;} to{transform:scale(1.6); opacity:0;}}
.shake{animation:shake .55s cubic-bezier(.36,.07,.19,.97);}
@keyframes shake{10%,90%{transform:translateX(-2px);} 20%,80%{transform:translateX(5px);} 30%,50%,70%{transform:translateX(-9px);} 40%,60%{transform:translateX(9px);}}

/* لافتة النتيجة فوق اللوح */
.banner{
  position:absolute; inset-inline:8%; top:40%; z-index:10;
  display:flex; flex-direction:column; align-items:center; gap:2px; text-align:center;
  padding:16px 18px; border-radius:22px; color:#fff; background:var(--fire);
  box-shadow:0 8px 0 var(--fire-dk), 0 24px 50px rgba(0,0,0,.35); pointer-events:none;
}
.banner.in{animation:bannerIn .5s cubic-bezier(.3,1.6,.5,1) both;}
@keyframes bannerIn{from{opacity:0; transform:scale(.6) translateY(20px);}}
.banner strong{font-size:clamp(1.4rem,4.2vw,2.3rem); line-height:1.35;}
.banner span{font-size:clamp(.9rem,2vw,1.05rem); opacity:.95;}
.banner-ico .ico{width:48px; height:48px;}
.banner[data-kind="miss"]{background:#0E7490; box-shadow:0 8px 0 #164E63, 0 24px 50px rgba(0,0,0,.3);}
.banner[data-kind="trap"]{background:var(--trap); box-shadow:0 8px 0 var(--trap-dk), 0 24px 50px rgba(0,0,0,.35);}
.banner[data-kind="sunk"]{background:var(--sunk); box-shadow:0 8px 0 #431407, 0 24px 50px rgba(0,0,0,.4);}
.banner[data-kind="sunk"] .banner-ico{color:#FDBA74;}

/* شريط الإطلاق */
.firebar{
  --tc:var(--accent);
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin-top:14px; padding:10px 10px 10px 16px; border-radius:18px;
  background:var(--surface); border:1px solid var(--line); border-inline-start:6px solid var(--tc);
}
.firebar p{margin:0; font-size:.95rem; color:var(--text);}
.btn-fire{
  min-width:140px; min-height:54px; font-size:1.15rem; border-radius:16px;
  background:var(--fire); color:#fff; border-color:transparent; box-shadow:0 6px 0 var(--fire-dk);
}
.btn-fire:hover{background:#FB8A3C;}
.btn-fire:active{box-shadow:0 2px 0 var(--fire-dk);}
.btn-fire:not(:disabled){animation:firePulse 1.4s ease-in-out infinite;}
@keyframes firePulse{50%{box-shadow:0 6px 0 var(--fire-dk), 0 0 0 9px rgba(249,115,22,.22);}}
.btn-fire:disabled{background:var(--surface-2); color:var(--text-2); box-shadow:0 6px 0 var(--line);}
.modeC-note{margin-top:8px; text-align:center;}

.legend{display:flex; flex-wrap:wrap; justify-content:center; gap:6px 16px; margin-top:12px; font-size:.8rem; color:var(--text-2);}
.legend span{display:inline-flex; align-items:center; gap:6px;}
.lg{width:15px; height:15px; border-radius:4px; display:inline-block; border:1px solid var(--frame-line);}
.lg.fog{background:var(--water);} .lg.miss{background:var(--miss-bg); border-color:var(--miss);}
.lg.hit{background:var(--fire);} .lg.sunk{background:var(--sunk);} .lg.trap{background:var(--trap);}

/* ---------- اللوحة الجانبية ---------- */
.side{display:flex; flex-direction:column; gap:12px; position:sticky; top:12px;}
.panel{background:var(--surface); border:1px solid var(--line); border-radius:20px; padding:14px; box-shadow:var(--shadow);}
.panel .card-head{margin-bottom:6px;}
.tip{margin-bottom:10px; font-size:.8rem;}
.code-chip{font-size:.8rem; padding:2px 10px; border-radius:999px; background:var(--surface-2); direction:rtl;}
.scores{display:flex; flex-direction:column; gap:7px;}
.srow{
  display:grid; grid-template-columns:28px minmax(0,1fr) auto auto; grid-template-rows:auto auto;
  align-items:center; gap:2px 8px;
  padding:8px 10px; border-radius:16px; background:var(--solid); border:2px solid var(--line);
  border-inline-start:6px solid var(--tc);
}
.srow.att{border-color:var(--tc); box-shadow:0 0 0 3px color-mix(in srgb, var(--tc) 25%, transparent);}
.rank{grid-row:1 / span 2; width:28px; height:28px; border-radius:50%; display:grid; place-items:center; background:var(--surface-2); font-weight:700; font-size:.9rem;}
.rank .ico{width:18px; height:18px; fill:#B45309;}
.srow:first-child .rank:has(.ico){background:var(--gold);}
.sname{display:flex; align-items:center; gap:6px; min-width:0; font-weight:700; text-align:start; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;}
.sname .dot{width:10px; height:10px;}
.presence{width:8px; height:8px; border-radius:50%; background:var(--line); flex:none;}
.presence.on{background:var(--ok);}
.spts{font-weight:700; font-size:1.15rem; white-space:nowrap; display:flex; align-items:baseline; gap:3px;}
.spts small{font-size:.68rem; color:var(--text-2); font-weight:500;}
.sstr{display:inline-flex; align-items:center; gap:1px; padding:0 8px 0 6px; border-radius:999px; background:var(--gold); color:var(--gold-ink); font-weight:700; font-size:.88rem;}
.sstr .ico{width:.9em; height:.9em;}
.sbtns{grid-column:2 / span 3; display:flex; gap:6px; margin-top:4px;}
.qbtn{
  flex:1; min-height:38px; border-radius:12px; display:grid; place-items:center;
  font-weight:700; font-size:1.1rem; border:1px solid var(--line); background:var(--surface);
  box-shadow:0 3px 0 var(--line); transition:transform .1s;
}
.qbtn:active{transform:translateY(2px); box-shadow:0 1px 0 var(--line);}
.qbtn .ico{width:22px; height:22px;}
.qbtn.ok{background:var(--ok); color:#fff; border-color:transparent; box-shadow:0 3px 0 #13774E; flex:2;}
.qbtn.no{background:var(--bad); color:#fff; border-color:transparent; box-shadow:0 3px 0 #B03A34;}
.qbtn.more{flex:.7;}
.scores.compact .srow{grid-template-columns:28px minmax(0,1fr) auto auto; grid-template-rows:auto;}
.scores.compact .rank{grid-row:auto;}

.log{max-height:300px; overflow-y:auto; display:flex; flex-direction:column; gap:5px; font-size:.82rem; padding-inline-end:2px;}
.log li{padding:6px 10px; border-radius:12px; background:var(--solid); border:1px solid var(--line); line-height:1.6;}
.log .lg-hit{border-inline-start:4px solid var(--fire);}
.log .lg-trap{border-inline-start:4px solid var(--trap);}
.log .lg-miss{border-inline-start:4px solid var(--miss);}
.log .lg-quiz{border-inline-start:4px solid var(--ok);}
.side-acts{display:flex; flex-direction:column; gap:6px;}

/* ---------- النهاية ---------- */
.end-hero{text-align:center; margin-bottom:16px;}
.medal{width:96px; height:96px; margin:0 auto 10px; border-radius:50%; display:grid; place-items:center; background:var(--gold); color:var(--gold-ink); box-shadow:0 7px 0 #B45309, 0 0 0 10px rgba(250,204,21,.22); animation:floaty 3s ease-in-out infinite;}
.medal .ico{width:54px; height:54px;}
@keyframes floaty{50%{transform:translateY(-8px);}}
.kicker{display:inline-block; padding:2px 14px; border-radius:999px; background:var(--fire); color:#fff; font-weight:700; font-size:.85rem; box-shadow:0 4px 0 var(--fire-dk);}
.end-hero h1{font-size:clamp(2rem,8vw,3.2rem); line-height:1.3; margin-top:8px; color:var(--text);}
.final{display:flex; flex-direction:column; gap:8px; margin-bottom:16px;}
.final li{display:flex; align-items:center; gap:10px; padding:10px 14px; border-radius:16px; background:var(--solid); border:2px solid var(--line); border-inline-start:6px solid var(--tc);}
.final li.first{border-color:var(--tc); box-shadow:0 4px 0 var(--tc);}
.final strong{flex:1; min-width:0;}
.final b{font-size:1.2rem;}
.final .rank{grid-row:auto;}
.final li.first .rank{background:var(--gold); color:var(--gold-ink);}

/* ---------- المحرر ---------- */
.editor{display:flex; flex-direction:column; gap:10px;}
.ed-tools{display:grid; grid-template-columns:repeat(6,1fr); gap:6px;}
.tool{
  display:flex; flex-direction:column; align-items:center; gap:0; padding:7px 4px 6px;
  border-radius:14px; background:var(--solid); border:2px solid var(--line); box-shadow:0 3px 0 var(--line);
  font-size:.82rem; line-height:1.35; transition:transform .1s, border-color .2s;
}
.tool:active{transform:translateY(2px); box-shadow:0 1px 0 var(--line);}
.tool .ico{width:26px; height:26px; color:var(--hull-W); margin-bottom:2px;}
.t-S .ico{color:var(--hull-S);} .t-B .ico{color:var(--hull-B);}
.t-sw .ico{color:#CA8A04;} .t-tr .ico,.t-er .ico{color:var(--trap);}
[data-theme="navy"] .t-sw .ico,[data-theme="blue"] .t-sw .ico,[data-theme="ops"] .t-sw .ico{color:var(--gold);}
.tool .tl{font-weight:700;}
.tool .tn{font-size:.7rem; color:var(--text-2);}
.tool.done{opacity:.55;}
.tool.done .tn{color:var(--ok);}
.tool.over{border-color:var(--trap);}
.tool.over .tn{color:var(--trap); font-weight:700;}
.tool[aria-pressed="true"]{border-color:var(--accent); background:var(--surface-2); box-shadow:0 3px 0 var(--accent); opacity:1;}
.ed-opts{display:flex; align-items:center; gap:10px; flex-wrap:wrap; min-height:40px;}
.chip-btn{display:inline-flex; align-items:center; gap:6px; min-height:38px; padding:4px 14px; border-radius:999px; background:var(--accent); color:var(--on-accent); font-weight:700; box-shadow:0 3px 0 rgba(10,36,99,.4);}
.chip-btn .ico{transition:transform .25s;}
.chip-btn.v .ico{transform:rotate(90deg);}
.batch{display:flex; align-items:center; gap:4px;}
.batch button{min-width:40px; min-height:36px; padding:0 8px; border-radius:10px; background:var(--solid); border:1px solid var(--line); font-weight:700;}
.batch button[aria-pressed="true"]{background:var(--gold); color:var(--gold-ink); border-color:transparent;}
.ed-hint{flex:1; min-width:180px; margin:0;}
.editor .board-wrap{max-width:560px; padding:8px; border-radius:18px; background:var(--frame); border:1px solid var(--frame-line);}
.ed-foot{display:flex; flex-direction:column; gap:8px;}
.prog{height:8px; border-radius:99px; background:var(--surface-2); overflow:hidden;}
.prog i{display:block; height:100%; background:linear-gradient(90deg,var(--hl),var(--accent)); border-radius:99px; transition:width .3s ease;}
.editor.complete .prog i{background:var(--ok);}
.prog-t{font-size:.85rem; font-weight:700;}
.editor.complete .prog-t{color:var(--ok);}
.ed-acts{display:flex; gap:6px; flex-wrap:wrap;}
.ed-acts .btn{flex:1; min-width:max-content;}

/* ---------- النوافذ والتنبيه ---------- */
.modal{position:fixed; inset:0; z-index:50; display:grid; place-items:center; padding:14px; background:var(--scrim); backdrop-filter:blur(4px); overflow-y:auto;}
.modal-card{
  width:min(100%,430px); text-align:center;
  background:var(--solid); border:1px solid var(--line); border-radius:24px; padding:22px 18px 18px;
  box-shadow:0 30px 60px rgba(0,0,0,.3);
  animation:modalIn .35s cubic-bezier(.3,1.5,.5,1) both;
}
.modal-card.big{width:min(100%,720px); text-align:start; max-height:calc(100dvh - 28px); overflow-y:auto;}
@keyframes modalIn{from{opacity:0; transform:scale(.88) translateY(20px);}}
.modal-head{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px;}
.modal-card h3{font-size:1.3rem; line-height:1.5; margin-bottom:6px;}
.modal-head h3{margin:0;}
.modal-card > p{color:var(--text-2); margin-bottom:16px;}
.modal-card.big > p{margin-bottom:10px;}
.modal-actions{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px;}
.adj{display:flex; flex-direction:column; gap:10px; text-align:start;}
.adj-row{display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:14px; background:var(--surface);}
.adj-row span{flex:1; color:var(--text-2);}
.adj-row b{font-size:1.3rem; min-width:3ch; text-align:center;}
.adj-btns{display:flex; gap:6px;}

.toast{
  position:fixed; inset-block-end:max(18px,env(safe-area-inset-bottom)); inset-inline:0; z-index:60;
  width:max-content; max-width:calc(100% - 28px); margin-inline:auto; text-align:center;
  background:var(--text); color:var(--bg); font-weight:700;
  padding:9px 18px; border-radius:999px; box-shadow:0 12px 30px rgba(0,0,0,.25);
}
.toast[data-kind="ok"]{background:var(--ok); color:#fff;}
.toast[data-kind="bad"]{background:var(--trap); color:#fff;}
.toast.in{animation:toastIn .3s ease both;}
@keyframes toastIn{from{opacity:0; transform:translateY(14px);}}
.confetti{position:fixed; inset:0; width:100%; height:100%; pointer-events:none; z-index:40;}

/* =========================================================
   جوال الفريق
   ========================================================= */
.phone{max-width:560px; margin:0 auto; width:100%;}
.field{display:block; margin-bottom:12px;}
.field span{display:block; font-weight:700; margin-bottom:6px;}
.code-input{
  width:100%; min-height:60px; padding:8px 14px; border-radius:16px; border:2px solid var(--line);
  background:var(--solid); text-align:center; font-size:1.7rem; font-weight:700; letter-spacing:.14em; outline:none;
}
.code-input:focus{border-color:var(--accent);}
.err{color:var(--trap); font-weight:700; margin-bottom:10px;}
[data-theme="navy"] .err,[data-theme="blue"] .err,[data-theme="ops"] .err{color:#FFB4B4;}

.me-card{
  --tc:var(--accent);
  display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
  padding:12px 14px; margin-bottom:12px; border-radius:20px;
  background:var(--solid); border:2px solid var(--tc); box-shadow:0 5px 0 var(--tc);
}
body.play .me-card{--tc:inherit;}
.me-card{border-color:var(--tc); box-shadow:0 5px 0 var(--tc);}
.me-id{display:flex; flex-direction:column; min-width:0;}
.me-id strong{font-size:1.25rem; display:flex; align-items:center; gap:8px;}
.me-id .dot{display:none;}
.me-stats{display:flex; gap:8px;}
.stat{display:flex; flex-direction:column; align-items:center; min-width:72px; padding:4px 10px; border-radius:14px; background:var(--surface-2); line-height:1.3;}
.stat small{font-size:.7rem; color:var(--text-2);}
.stat b{font-size:1.4rem;}
.stat.strikes{background:var(--gold); color:var(--gold-ink);}
.stat.strikes small{color:var(--gold-ink);}
.stat.bump{animation:bump .5s cubic-bezier(.3,1.6,.5,1);}
@keyframes bump{40%{transform:scale(1.18);}}

.wait{display:flex; flex-direction:column; align-items:center; text-align:center; gap:4px; padding:26px 18px;}
.mini-sweep{
  width:64px; height:64px; border-radius:50%; margin-bottom:6px; flex:none;
  background:conic-gradient(from 0deg, var(--hl), transparent 70deg), var(--water);
  border:3px solid var(--accent); animation:sweep 2.4s linear infinite;
}
.status{display:flex; align-items:center; gap:12px; flex-wrap:wrap;}
.status > div{flex:1; min-width:160px;}
.status .st-ico{width:46px; height:46px; border-radius:50%; display:grid; place-items:center; background:var(--ok); color:#fff; flex:none;}
.status .st-ico .ico{width:28px; height:28px;}
.status.wait{flex-direction:row; padding:18px;}
.status.wait .st-ico{background:transparent;}
.status.wait .mini-sweep{width:40px; height:40px; margin:0; border-width:2px;}
.status.ok{border-color:var(--ok);}
#drawBox .btn-big{margin-top:12px;}
.tabs2{margin-bottom:12px;}
.tabs2 button{font-size:1rem;}
body.play .pick-l{width:auto;}
.mini-scores{margin-top:14px;}
.end-card{text-align:center;}
.end-card h2{font-size:1.8rem; margin:6px 0 2px;}
.end-card .final{margin-top:14px; text-align:start;}

/* ---------- المقاسات ---------- */
@media (max-width:1100px){
  .battle{grid-template-columns:1fr;}
  .side{position:static;}
  .host .arena .board-wrap{max-width:min(720px,100%);}
  .scores{display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr));}
}
@media (max-width:760px){
  .units{grid-template-columns:repeat(3,1fr);}
  .units .unit:nth-child(4),.units .unit:nth-child(5){grid-column:span 1;}
  .modes{grid-template-columns:1fr;}
  .mode-art{height:40px;}
  .ed-tools{grid-template-columns:repeat(3,1fr);}
}
@media (max-width:520px){
  .topbar{padding:8px 10px; gap:6px;}
  .brand .logo{height:38px;}
  .brand-text strong{font-size:.98rem;}
  .brand-text small{display:none;}
  .theme-dot{width:24px; height:24px;}
  .theme-switch{gap:3px; padding:3px;}
  .icon-btn{width:38px; height:38px;}
  .net b{display:none;}
  .net{padding:6px;}
  main{padding:10px;}
  .units{grid-template-columns:repeat(2,1fr);}
  .units .unit:last-child{grid-column:span 2;}
  .modes.two{grid-template-columns:1fr;}
  .card{padding:14px;}
  .radar-frame{padding:8px 6px 10px; border-radius:18px;}
  .firebar{flex-direction:column; align-items:stretch; padding:10px;}
  .btn-fire{width:100%;}
  .pick{flex-direction:column; align-items:stretch; gap:2px;}
  .pick-l{width:auto;}
  .tjoin .qr{width:92px; height:92px;}
  .actions{flex-direction:column-reverse;}
  .badge{font-size:8px;}
  .banner{inset-inline:4%; padding:12px;}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important;}
}

/* زر سؤال ديوان لكل فريق، وزر الجولة في وضع «بدون أسئلة» */
.qbtn.ask{font-weight:700; font-size:1.1rem; flex:1.2;}
.round-strike{width:100%; margin:4px 0 10px;}
