/* ========================================
   الإعدادات الأساسية
======================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}

input,
textarea {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}


body {

    background: #111111;

    color: white;

    font-family: Arial, sans-serif;

    min-height: 100vh;

    overflow-x: hidden;

}


/* ========================================
   التطبيق
======================================== */

#app {

    min-height: 100vh;

}


/* ========================================
   الشريط العلوي
======================================== */

.top-bar {

    width: 100%;

    min-height: 70px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 15px 20px;

    background: #1b1b1b;

    border-bottom: 2px solid #333333;

}


.game-title {

    font-size: 20px;

    font-weight: bold;

}


.player-info {

    display: flex;

    gap: 15px;

    align-items: center;

    font-size: 14px;

}


/* ========================================
   المحتوى
======================================== */

#main-content {

    width: 100%;

    max-width: 700px;

    margin: auto;

    padding: 25px 15px;

}


/* ========================================
   الشاشات
======================================== */

.screen {

    display: none;

    text-align: center;

}


.screen.active {

    display: block;

}


/* ========================================
   العناوين
======================================== */

h1 {

    font-size: 32px;

    margin-top: 40px;

}


h2 {

    font-size: 28px;

    margin-bottom: 15px;

}


h3 {

    margin-bottom: 15px;

}


.subtitle {

    margin-top: 10px;

    margin-bottom: 20px;

    color: #aaaaaa;

}


/* ========================================
   القوائم
======================================== */

.menu {

    display: flex;

    flex-direction: column;

    gap: 15px;

    margin-top: 40px;

}


/* ========================================
   الأزرار
======================================== */

button {
    
    padding: 16px;
    
    border: 1px solid #444444;
    
    border-radius: 10px;
    
    background: #222222;
    
    color: white;
    
    font-size: 17px;
    
    cursor: pointer;
    
}


button:active {

    transform: scale(0.98);

}


/* ========================================
   بطاقات الشخصيات
======================================== */

#character-list {

    display: flex;

    flex-direction: column;

    gap: 15px;

    margin-top: 25px;

}


.character-card {

    display: flex;

    align-items: center;

    gap: 15px;

    padding: 12px;

    background: #1b1b1b;

    border: 1px solid #333333;

    border-radius: 12px;

    text-align: right;

    cursor: pointer;

}


.character-card:active {

    transform: scale(0.98);

}


/* بطاقة تحدٍّ وارد داخل ردهة PvP (تحل محل النافذة المنبثقة القديمة) */
.pvp-incoming-card{

    background: linear-gradient(160deg, #2a1a10, #1b1b1b);

    border: 1px solid rgba(255,180,60,0.5);

    box-shadow: 0 0 18px rgba(255,150,40,0.25);

}

.pvp-incoming-note{

    color: #ffb43c;

    font-size: 13px;

    margin-top: 4px;

}

.pvp-incoming-buttons{

    display: flex;

    flex-direction: column;

    gap: 6px;

}

.pvp-incoming-buttons .pvp-accept-btn{

    background: linear-gradient(160deg, #1f9d55, #167a41);

    color: #fff;

    border: none;

    border-radius: 8px;

    padding: 8px 12px;

    font-size: 13px;

}

.pvp-incoming-buttons .pvp-decline-btn{

    background: #2a2a2a;

    color: #ccc;

    border: 1px solid #444;

    border-radius: 8px;

    padding: 6px 12px;

    font-size: 12px;

}


.character-image {

    width: 110px;

    height: 140px;

    object-fit: cover;

    border-radius: 8px;

    background: #222222;

}


.character-info {

    flex: 1;

}


/* منتقي لون التوهج داخل بطاقة "مجموعتي" */
.glow-picker-row{

display:flex;

align-items:center;

justify-content:space-between;

gap:8px;

margin-top:8px;

font-size:13px;

color:#ccc;

}

.glow-picker-row input[type="color"]{

width:36px;

height:26px;

padding:0;

border:none;

border-radius:6px;

background:transparent;

cursor:pointer;

}

.glow-locked-note{

margin-top:8px;

font-size:12px;

color:#999;

}


.character-name {

    font-size: 21px;

    font-weight: bold;

    margin-bottom: 10px;

}


.character-stats {

    color: #bbbbbb;

    line-height: 1.8;

}


/* ========================================
   صندوق طلب الشخصية
======================================== */

.request-character-box {

    margin-top: 30px;

    margin-bottom: 20px;

    padding: 20px;

    background: #181818;

    border: 1px solid #333333;

    border-radius: 12px;

}


/* ========================================
   النماذج
======================================== */

.form-box {

    display: flex;

    flex-direction: column;

    gap: 12px;

    margin-top: 25px;

}


.form-box label {

    text-align: right;

    color: #cccccc;

}


.form-box input,

.form-box textarea {

    width: 100%;

    padding: 14px;

    border-radius: 8px;

    border: 1px solid #444444;

    background: #1b1b1b;

    color: white;

    font-size: 16px;

}


.form-box textarea {

    min-height: 120px;

    resize: vertical;

}


.form-box input:focus,

.form-box textarea:focus {

    outline: none;

    border-color: #777777;

}


/* ========================================
   البطاقات الفارغة
======================================== */

.empty-card {

    width: 100%;

    padding: 50px 20px;

    margin-bottom: 20px;

    border: 1px solid #333333;

    border-radius: 12px;

    background: #1b1b1b;

    color: #999999;

}

#character-profile-screen {
    display: none;
    text-align: center;
    padding-top: 20px;
}


#character-profile-screen.active {
    display: block;
}


#character-profile {
    margin-top: 0;
}

.screen {
    min-height: auto;
}


#character-profile-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}


.battle-arena{

display:flex;
flex-direction:column;

align-items:center;

gap:20px;

width:100%;

}



.battle-card{

width:90%;

background:#111;

border-radius:15px;

padding:15px;

text-align:center;

}



.enemy-card{

order:1;

}



.battle-middle{

order:2;

display:flex;

flex-direction:column;

align-items:center;

gap:15px;

}



.player-card{

order:3;

}



.battle-image{

width:90px;

height:90px;

object-fit:cover;

border-radius:10px;

}



.hp-bar{

width:90%;

height:15px;

background:#333;

border-radius:10px;

margin:auto;

overflow:hidden;

}



.hp-fill{

height:100%;

background:red;

width:100%;

}



.used-skills{

min-height:50px;

border:1px solid #555;

border-radius:10px;

margin:10px;

padding:8px;

display:flex;

flex-wrap:wrap;

gap:8px;

align-items:flex-start;

justify-content:center;

}


.used-skill-chip{

display:inline-flex;

align-items:center;

justify-content:center;

background: linear-gradient(160deg,#20202a,#141418);

border:1px solid rgba(255,255,255,0.15);

border-radius:8px;

padding:6px 10px;

color:#fff;

font-size:13px;

white-space:nowrap;

box-shadow: 0 0 8px rgba(0,0,0,0.4);

position:relative;

cursor:pointer;

user-select:none;

-webkit-user-select:none;

-webkit-touch-callout:none;

}


.used-skill-chip.on-cooldown{

opacity: 0.55;

}



#pve-attack-button,
#pvp-attack-button {

width:70px;

height:70px;

border-radius:50%;

background:red;

color:white;

font-size:30px;

border:none;

position:relative;

}




/* ========================================
   صفحات المهارات (نظام إظهار/إخفاء بسيط)
======================================== */

.skills-container {

    width: 100%;

}


.skills-pages {

    width: 100%;

}


/* كل صفحة مهارات مخفية افتراضيًا، والصفحة النشطة فقط تظهر */

.skills-page {

    display: none;

    grid-template-columns: 1fr 1fr;

    gap: 10px;

}


.skills-page.active {

    display: grid;

}


.skills-page button {

    width: 100%;

}


/* النقاط الدالة على الصفحة الحالية */

.skill-dots {

    display: flex;

    justify-content: center;

    gap: 8px;

    margin-top: 12px;

}


.skill-dots span {

    width: 8px;

    height: 8px;

    border-radius: 50%;

    background: #444444;

    cursor: pointer;

}


.skill-dots span.active {

    background: #ffffff;

}


/* ترتيب أزرار المواجهات الفردية */

#solo-battle-screen .solo-buttons {
    display: flex;
    flex-direction: row;
    direction: rtl;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
    margin-top: 30px;
}


#solo-battle-screen .solo-buttons button {
    flex: 1;
    height: 55px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;
}


#solo-battle-screen > button {
    margin-top: 40px;
}

/* ========================================
   ساحة القتال - تحسينات بصرية أنمي
======================================== */

.battle-arena{

background:
radial-gradient(circle at 50% 15%, rgba(255,60,60,0.15), transparent 60%),
radial-gradient(circle at 50% 85%, rgba(60,120,255,0.15), transparent 60%),
#0a0a0f;

border-radius:18px;

padding:20px 10px;

position:relative;

overflow:hidden;

box-shadow: inset 0 0 60px rgba(0,0,0,0.6);

}

.battle-arena::before{

content:"";

position:absolute;

top:0; left:0; right:0; bottom:0;

background-image:
linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);

background-size: 25px 25px;

pointer-events:none;

}


.battle-card{

background: linear-gradient(160deg, #1a1a22, #0c0c10);

border:1px solid rgba(255,255,255,0.08);

box-shadow: 0 0 25px rgba(0,0,0,0.6);

position:relative;

z-index:1;

transition: box-shadow .3s ease, transform .2s ease, border-color .3s ease;

}

.enemy-card{

border-color: var(--glow-border, rgba(255,70,70,0.35));

box-shadow: 0 0 25px var(--glow-shadow, rgba(255,40,40,0.15));

}

.player-card{

border-color: var(--glow-border, rgba(80,150,255,0.35));

box-shadow: 0 0 25px var(--glow-shadow, rgba(60,130,255,0.18));

}


.battle-image{

width:100px;

height:100px;

border:2px solid rgba(255,255,255,0.15);

box-shadow: 0 0 20px rgba(255,255,255,0.15);

animation: floatCard 3s ease-in-out infinite;

}

.enemy-card .battle-image{
border-color: var(--glow-border, rgba(255,70,70,0.6));
box-shadow: 0 0 25px var(--glow-shadow-strong, rgba(255,40,40,0.45));
}

.player-card .battle-image{
border-color: var(--glow-border, rgba(80,150,255,0.6));
box-shadow: 0 0 25px var(--glow-shadow-strong, rgba(60,130,255,0.45));
}


@keyframes floatCard{
0%,100%{ transform: translateY(0); }
50%{ transform: translateY(-6px); }
}


/* شريط HP متوهج */

.hp-bar{

background:#1a1a1a;

box-shadow: inset 0 0 8px rgba(0,0,0,0.8);

}

.hp-fill{

background: linear-gradient(90deg,#ff2b2b,#ff7a45);

box-shadow: 0 0 12px rgba(255,60,60,0.8);

transition: width .5s ease;

}

.hp-fill.hp-mid{
background: linear-gradient(90deg,#ffb020,#ffd84d);
box-shadow: 0 0 12px rgba(255,190,40,0.8);
}

.hp-fill.hp-low{
background: linear-gradient(90deg,#ff2b2b,#8c0000);
box-shadow: 0 0 16px rgba(255,20,20,1);
animation: hpPulse .8s infinite;
}

@keyframes hpPulse{
0%,100%{ filter:brightness(1); }
50%{ filter:brightness(1.4); }
}


/* منتصف القتال - VS متوهج */

.battle-middle{

position:relative;

}

#pve-battle-effect,
#pvp-battle-effect{

font-size:26px;

font-weight:bold;

background: linear-gradient(90deg,#ff4d4d,#4d9aff);

-webkit-background-clip:text;

background-clip:text;

color:transparent;

text-shadow: 0 0 20px rgba(255,255,255,0.3);

animation: vsGlow 1.6s ease-in-out infinite;

}

@keyframes vsGlow{
0%,100%{ opacity:0.7; transform:scale(1); }
50%{ opacity:1; transform:scale(1.1); }
}


#pve-battle-timer,
#pvp-battle-timer{

font-size:20px;

font-weight:bold;

color:#fff;

background: rgba(255,255,255,0.06);

border:1px solid rgba(255,255,255,0.15);

width:44px; height:44px;

border-radius:50%;

display:flex;

align-items:center;

justify-content:center;

box-shadow: 0 0 15px rgba(255,255,255,0.1);

}


/* زر الهجوم - نبض ناري */

#pve-attack-button,
#pvp-attack-button{

background: radial-gradient(circle, #ff5b3d, #b30f0f);

box-shadow: 0 0 25px rgba(255,60,20,0.7);

animation: attackPulse 1.5s infinite;

}

@keyframes attackPulse{
0%,100%{ box-shadow: 0 0 20px rgba(255,60,20,0.5); }
50%{ box-shadow: 0 0 35px rgba(255,90,30,0.9); }
}

#pve-attack-button:active,
#pvp-attack-button:active{

transform: scale(0.9);

box-shadow: 0 0 45px rgba(255,120,40,1);

}


#pve-attack-button.locked,
#pvp-attack-button.locked{

animation: none;

background: radial-gradient(circle, #555, #222);

box-shadow: 0 0 10px rgba(0,0,0,0.6) inset;

opacity: 0.6;

}


/* مهارات اللاعب */

.skills-page button{

background: linear-gradient(160deg,#20202a,#141418);

border:1px solid rgba(255,255,255,0.1);

transition: all .2s ease;

position: relative;

user-select: none;

-webkit-user-select: none;

-webkit-touch-callout: none;

}


.skills-page button.on-cooldown{

opacity: 0.55;

}


.cooldown-badge{

position: absolute;

top: -6px;

left: -6px;

min-width: 20px;

height: 20px;

padding: 0 4px;

border-radius: 50%;

background: #ff3c3c;

color: #fff;

font-size: 12px;

font-weight: bold;

display: flex;

align-items: center;

justify-content: center;

box-shadow: 0 0 6px rgba(0,0,0,0.5);

}

.skills-page button:active{

border-color: rgba(255,150,80,0.6);

box-shadow: 0 0 15px rgba(255,150,80,0.4);

transform: scale(0.96);

}


/* تأثير اهتزاز الشاشة عند الضربة */

.shake{

animation: shakeAnim .35s ease;

}

@keyframes shakeAnim{
0%,100%{ transform: translateX(0); }
20%{ transform: translateX(-8px); }
40%{ transform: translateX(8px); }
60%{ transform: translateX(-5px); }
80%{ transform: translateX(5px); }
}


/* رقم الداميج الطائر */

.damage-popup{

position:absolute;

font-size:26px;

font-weight:bold;

color:#ff4d4d;

text-shadow: 0 0 10px rgba(255,60,60,0.9);

pointer-events:none;

animation: floatUp 1s ease-out forwards;

z-index:10;

}

.damage-popup.heal{
color:#4dff8a;
text-shadow: 0 0 10px rgba(80,255,140,0.9);
}

@keyframes floatUp{
0%{ opacity:1; transform: translateY(0) scale(1); }
100%{ opacity:0; transform: translateY(-60px) scale(1.3); }
}


/* فلاش الضربة على الأرينا كلها */

.hit-flash::after{

content:"";

position:absolute;

top:0; left:0; right:0; bottom:0;

background: rgba(255,255,255,0.25);

animation: flashOut .25s ease;

pointer-events:none;

}

@keyframes flashOut{
0%{ opacity:1; }
100%{ opacity:0; }
}

/* ========================================
   إضافات إضافية: سجل الأحداث + نافذة السرقة
======================================== */

.log-toggle-btn{

width:90%;

margin:10px auto 0 auto;

display:block;

padding:10px;

background:#1b1b1b;

border:1px solid #444;

border-radius:10px;

color:#ddd;

font-size:14px;

}


.battle-log{

width:90%;

margin:8px auto 15px auto;

max-height:0;

overflow-y:auto;

background:#0d0d10;

border:1px solid #333;

border-radius:10px;

padding:0 10px;

font-size:13px;

color:#ccc;

text-align:right;

transition: max-height .3s ease, padding .3s ease;

}

.battle-log.open{

max-height:150px;

padding:10px;

}


.steal-modal{

position:fixed;

top:0;left:0;right:0;bottom:0;

background:rgba(0,0,0,0.75);

display:flex;

align-items:center;

justify-content:center;

z-index:200;

padding:20px;

}

.steal-modal-box{

background:#161616;

border:1px solid #444;

border-radius:14px;

padding:20px;

width:100%;

max-width:400px;

text-align:center;

}

.steal-options-list{

display:flex;

flex-direction:column;

gap:8px;

margin:12px 0;

max-height:150px;

overflow-y:auto;

}

.steal-option{

background:#222;

border:1px solid #555;

border-radius:8px;

padding:10px;

color:#fff;

position:relative;

}

.steal-option.on-cooldown{

opacity:0.5;

cursor:not-allowed;

}

.steal-option.steal-selected{

background:#2f6f3e;

border-color:#4caf50;

box-shadow:0 0 0 2px rgba(76,175,80,0.4) inset;

}

.steal-option:disabled{

opacity:0.5;

cursor:not-allowed;

}

.steal-or{

color:#999;

font-size:13px;

margin:10px 0;

}

.steal-modal-box input{

width:100%;

padding:12px;

border-radius:8px;

border:1px solid #444;

background:#1b1b1b;

color:#fff;

margin-bottom:15px;

}

.steal-modal-buttons{

display:flex;

gap:10px;

}

.steal-modal-buttons button{

flex:1;

}

#steal-confirm-btn{

background:linear-gradient(160deg,#7a2dff,#3c0f9c);

border:none;

}


.skill-desc-text{

color:#ddd;

font-size:14px;

line-height:1.6;

margin:10px 0;

text-align:right;

}


.skill-detail-line{

color:#bbb;

font-size:13px;

margin:6px 0;

text-align:right;

}


.skill-detail-line strong{

color:#fff;

}


#skill-details-close-btn{

background:linear-gradient(160deg,#333,#1a1a1a);

border:1px solid #555;

}


/* ========================================
   المقدمة السينمائية: تصادم بطاقتي اللاعب والخصم
   (اللاعب يصعد من الأسفل، الخصم ينزل من الأعلى)
======================================== */

.intro-card{

position:absolute;

left:50%;

width:110px;

height:110px;

border-radius:14px;

background-size:cover;

background-position:center;

background-color:#15151c;

border:2px solid rgba(255,255,255,0.25);

box-shadow:0 0 30px rgba(0,0,0,0.7);

transform:translateX(-50%);

z-index:5;

transition: top .55s cubic-bezier(.36,.02,.66,.99), bottom .55s cubic-bezier(.36,.02,.66,.99);

}

.intro-card.bounce-back{

transition: top .4s cubic-bezier(.34,1.56,.64,1), bottom .4s cubic-bezier(.34,1.56,.64,1);

}

.intro-enemy{

top:-140px;

border-color: rgba(255,70,70,0.7);

box-shadow: 0 0 25px rgba(255,40,40,0.5);

}

.intro-player{

bottom:-140px;

border-color: rgba(80,150,255,0.7);

box-shadow: 0 0 25px rgba(60,130,255,0.5);

}

/* مرحلة الاصطدام: البطاقتان تتلامسان بالضبط عند منتصف الساحة */
.intro-enemy.slide-in{

top: calc(50% - 110px);

}

.intro-player.slide-in{

bottom: calc(50% - 110px);

}

/* مرحلة الارتداد: بعد الاصطدام، كل بطاقة ترجع للخلف قليلًا ويبقى بينهما فراغ لظهور VS والأمواج */
.intro-enemy.bounce-back{

top: calc(50% - 155px);

}

.intro-player.bounce-back{

bottom: calc(50% - 155px);

}

.intro-vs{

position:absolute;

top:50%;

left:50%;

transform:translate(-50%,-50%) scale(0);

font-size:40px;

font-weight:900;

font-style:italic;

letter-spacing:2px;

background: linear-gradient(90deg, #ff2d2d, #3b82ff);

-webkit-background-clip:text;

background-clip:text;

color:transparent;

filter:
    drop-shadow(0 0 14px rgba(255,45,45,0.8))
    drop-shadow(0 0 14px rgba(59,130,255,0.8));

z-index:8;

opacity:0;

transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .25s ease;

}

.intro-vs.show{

opacity:1;

transform:translate(-50%,-50%) scale(1.2);

animation: vsPulse 1.2s ease-in-out infinite .35s;

}

/* خطا الضوء المتوهجان اللذان ينفجران أفقيًا عند لحظة الاصطدام */

.intro-vs-line{

position:absolute;

top:50%;

height:4px;

border-radius:4px;

background: linear-gradient(90deg, #ff2d2d, #3b82ff, #ff2d2d, #3b82ff);

background-size:300% 100%;

opacity:0;

z-index:6;

transition: transform .45s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;

}

.intro-vs-line-left{

left:0;

right:50%;

transform: translateY(-50%) scaleX(0);

transform-origin: right center;

}

.intro-vs-line-right{

left:50%;

right:0;

transform: translateY(-50%) scaleX(0);

transform-origin: left center;

}

.intro-vs-line.show{

opacity:1;

}

.intro-vs-line-left.show{

transform: translateY(-50%) scaleX(1);

animation: vsLineFlow 2.5s linear infinite, vsLineGlow 1.8s ease-in-out infinite;

}

.intro-vs-line-right.show{

transform: translateY(-50%) scaleX(1);

animation: vsLineFlow 2.5s linear infinite reverse, vsLineGlow 1.8s ease-in-out infinite;

}

/* أمواج ملوّنة تنبعث من نقطة الاصطدام بلون كل مقاتل (يُحدَّد اللون من JS عبر currentColor) */
.intro-wave{

position:absolute;

top:50%;

left:50%;

width:20px;

height:20px;

margin:-10px 0 0 -10px;

border-radius:50%;

border:3px solid currentColor;

opacity:0;

z-index:7;

pointer-events:none;

}

.intro-wave.show{

animation: waveExpand 1.1s ease-out;

}

@keyframes waveExpand{
0%{ transform:scale(0.3); opacity:0.9; }
60%{ opacity:0.4; }
100%{ transform:scale(9); opacity:0; }
}

.intro-flash{

position:absolute;

inset:0;

background:radial-gradient(circle, rgba(255,255,255,0.95), rgba(255,255,255,0) 70%);

opacity:0;

z-index:6;

pointer-events:none;

}

.intro-flash.play{

animation: introFlashPop .5s ease-out;

}

@keyframes introFlashPop{
0%{ opacity:0; }
15%{ opacity:1; }
100%{ opacity:0; }
}

.battle-arena.shake{

animation: arenaShake .5s ease;

}

@keyframes arenaShake{
0%,100%{ transform:translateX(0); }
20%{ transform:translateX(-8px); }
40%{ transform:translateX(7px); }
60%{ transform:translateX(-5px); }
80%{ transform:translateX(4px); }
}



/* ========================================
   عداد 3-2-1 فوق زر الهجوم
======================================== */

.count-overlay{

position:absolute;

top:50%;

left:50%;

transform:translate(-50%,-50%) scale(0);

font-size:42px;

font-weight:900;

color:#fff;

text-shadow:0 0 25px rgba(255,60,20,0.9);

opacity:0;

pointer-events:none;

z-index:8;

}

.count-overlay.show{

animation: countPop .75s ease-out;

}

@keyframes countPop{
0%{ opacity:0; transform:translate(-50%,-50%) scale(0.3); }
25%{ opacity:1; transform:translate(-50%,-50%) scale(1.3); }
70%{ opacity:1; transform:translate(-50%,-50%) scale(1); }
100%{ opacity:0; transform:translate(-50%,-50%) scale(1); }
}



/* ========================================
   اختفاء زر الهجوم مع مساحته بالكامل بعد الضغط
   (تقترب بطاقة اللاعب من بطاقة الخصم بدل ترك فراغ)
======================================== */

.attack-button-wrap{

position:relative;

display:flex;

align-items:center;

justify-content:center;

overflow:hidden;

max-height:100px;

opacity:1;

transform:scale(1);

transition: max-height .45s ease, opacity .35s ease, margin .45s ease, transform .35s ease;

}

.attack-button-wrap.button-gone{

max-height:0;

opacity:0;

transform:scale(.6);

margin:0;

pointer-events:none;

}

/* تقارب أكبر بين البطاقتين بعد اختفاء زر الهجوم */

.battle-arena.cards-engaged{

gap:8px;

}

.battle-arena.cards-engaged .battle-middle{

gap:4px;

}


/* ========================================
   نتيجة المعركة (فوز/خسارة) وزر الرجوع
======================================== */

.battle-result-overlay{

position:absolute;

top:0;left:0;right:0;bottom:0;

background:rgba(0,0,0,0.82);

display:flex;

flex-direction:column;

align-items:center;

justify-content:center;

gap:20px;

z-index:150;

border-radius:inherit;

animation: battleResultFadeIn .35s ease;

}

@keyframes battleResultFadeIn{

from{ opacity:0; }

to{ opacity:1; }

}

.battle-result-overlay h2{

font-size:28px;

color:#fff;

text-shadow:0 0 12px rgba(0,0,0,0.6);

}

#battle-result-back-btn{

background:linear-gradient(160deg,#ff4d4d,#a30d0d);

border:1px solid #ff6b6b;

color:#fff;

font-size:16px;

font-weight:bold;

padding:12px 34px;

border-radius:10px;

box-shadow:0 0 14px rgba(255,60,60,0.5);

cursor:pointer;

transition: transform .15s ease, box-shadow .15s ease;

}

#battle-result-back-btn:active{

transform:scale(0.95);

box-shadow:0 0 6px rgba(255,60,60,0.4);

}


/* ========================================
   فاصل VS المتوهج بين البطاقتين
======================================== */

.vs-divider{

display:flex;

align-items:center;

justify-content:center;

width:100%;

gap:10px;

}

.vs-line{

flex:1;

height:4px;

border-radius:4px;

background: linear-gradient(
    90deg,
    #ff2d2d, #3b82ff, #ff2d2d, #3b82ff
);

background-size:300% 100%;

animation:
    vsLineFlow 2.5s linear infinite,
    vsLineGlow 1.8s ease-in-out infinite;

}

.vs-line-left{
    animation-direction: normal, alternate;
}

.vs-line-right{
    animation-direction: reverse, alternate;
}

@keyframes vsLineFlow{

0%{ background-position: 0% 50%; }

100%{ background-position: 300% 50%; }

}

@keyframes vsLineGlow{

0%,100%{
    box-shadow:
        0 0 6px rgba(255,45,45,0.7),
        0 0 6px rgba(59,130,255,0.7);
}

50%{
    box-shadow:
        0 0 16px rgba(255,45,45,1),
        0 0 16px rgba(59,130,255,1);
}

}

.vs-text{

flex-shrink:0;

font-size:22px;

font-weight:900;

letter-spacing:2px;

font-style:italic;

background: linear-gradient(90deg, #ff2d2d, #3b82ff);

-webkit-background-clip:text;

background-clip:text;

color:transparent;

filter:
    drop-shadow(0 0 6px rgba(255,45,45,0.7))
    drop-shadow(0 0 6px rgba(59,130,255,0.7));

animation: vsPulse 1.6s ease-in-out infinite;

}

@keyframes vsPulse{

0%,100%{ transform:scale(1); }

50%{ transform:scale(1.12); }

}


/* ========================================
   لوحة الإدارة الجديدة: بطاقات الشخصيات + نموذج الإضافة + نافذة التعديل
======================================== */

.admin-character-card{

display:flex;

align-items:center;

gap:12px;

background: linear-gradient(160deg, #1a1a22, #101014);

border:1px solid rgba(255,255,255,0.1);

border-radius:14px;

padding:12px;

margin-bottom:12px;

text-align:right;

}

.admin-thumb-wrap{

flex-shrink:0;

width:64px;

height:64px;

border-radius:10px;

overflow:hidden;

border:2px solid rgba(255,255,255,0.15);

background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(255,255,255,0.18)'><path d='M12 12c2.7 0 8 1.34 8 4v2H4v-2c0-2.66 5.3-4 8-4zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8z'/></svg>"),
    linear-gradient(160deg, #1c1c24, #101014);

background-repeat: no-repeat, no-repeat;

background-position: center, center;

background-size: 26px 26px, cover;

}

.admin-thumb{

width:100%;

height:100%;

object-fit:cover;

}

.admin-character-info{

flex:1;

min-width:0;

}

.admin-character-info h3{

margin-bottom:4px;

font-size:17px;

}

.admin-character-anime{

color:#999;

font-size:13px;

margin-bottom:4px;

}

.admin-character-stats{

color:#ddd;

font-size:13px;

margin-bottom:4px;

}

.admin-character-owner{

color:#888;

font-size:12px;

}

.admin-character-actions{

display:flex;

flex-direction:column;

gap:6px;

flex-shrink:0;

}

.admin-character-actions button{

padding:8px 12px;

font-size:13px;

white-space:nowrap;

}


.admin-add-form{

margin-bottom:10px;

}


.admin-edit-box{

max-width:420px;

max-height:85vh;

overflow-y:auto;

}

.admin-skills-edit-list{

display:flex;

flex-direction:column;

gap:10px;

margin:12px 0;

}

.admin-skill-edit-row{

display:flex;

align-items:center;

gap:6px;

flex-wrap:wrap;

background:#1b1b1b;

border:1px solid #333;

border-radius:10px;

padding:8px;

}

.admin-skill-edit-name{

flex:1 1 100%;

font-size:14px;

color:#fff;

margin-bottom:4px;

}

.admin-skill-edit-name small{

color:#999;

}

.admin-skill-edit-row input{

flex:1;

min-width:70px;

padding:8px;

border-radius:6px;

border:1px solid #444;

background:#121212;

color:#fff;

}

.admin-skill-edit-row button{

flex-shrink:0;

padding:8px 12px;

font-size:13px;

}


/* نموذج إضافة مهارة جديدة لشخصية/وحش */
.admin-add-skill-form{

display:flex;

flex-direction:column;

gap:8px;

margin:12px 0;

}

.admin-add-skill-form select{

padding:10px;

border-radius:8px;

border:1px solid #444;

background:#121212;

color:#fff;

font-size:14px;

}

/* checkbox "وحش PvE" في نماذج الإضافة/التعديل */
.admin-checkbox-label{

display:flex;

align-items:center;

gap:8px;

font-size:14px;

color:#fff;

background:#1b1b1b;

border:1px solid #333;

border-radius:10px;

padding:10px;

cursor:pointer;

}

.admin-checkbox-label input{

width:18px;

height:18px;

flex-shrink:0;

}


/* صف اختيار لون التوهج في لوحة الإدارة */
.admin-color-row{

display:flex;

align-items:center;

justify-content:space-between;

gap:10px;

font-size:14px;

color:#fff;

background:#1b1b1b;

border:1px solid #333;

border-radius:10px;

padding:10px;

}

.admin-color-row input[type="color"]{

width:44px;

height:32px;

padding:0;

border:none;

border-radius:6px;

background:transparent;

cursor:pointer;

}


/* ========================================
   لوحة الإدارة: بطاقات اللاعبين وتعديل الذهب
======================================== */

.admin-player-card{

display:flex;

align-items:center;

justify-content:space-between;

flex-wrap:wrap;

gap:12px;

background: linear-gradient(160deg, #1a1a22, #101014);

border:1px solid rgba(255,255,255,0.1);

border-radius:14px;

padding:12px;

margin-bottom:12px;

text-align:right;

max-width:100%;

}

.admin-player-info{

min-width:0;

flex:1 1 140px;

}

.admin-player-info h3{

font-size:16px;

margin-bottom:4px;

overflow-wrap:break-word;

}

.admin-player-sub{

color:#999;

font-size:13px;

}

.admin-player-gold-edit{

display:flex;

align-items:center;

flex-wrap:wrap;

justify-content:flex-end;

gap:6px;

flex-shrink:1;

min-width:0;

max-width:100%;

}

.admin-player-gold-edit input{

width:90px;

padding:8px;

border-radius:6px;

border:1px solid #444;

background:#121212;

color:#fff;

text-align:center;

}

.admin-player-gold-edit button{

padding:8px 12px;

font-size:13px;

white-space:nowrap;

}

.admin-danger-btn{

background:#5a1414 !important;

color:#ff6b6b !important;

border:1px solid #7a1f1f !important;

}

.admin-danger-btn:hover{

background:#7a1f1f !important;

}


/* ========================================
   رفع صورة من الجهاز
======================================== */

input[type="file"]{

background:#1b1b1b;

border:1px dashed #555;

padding:12px;

color:#ccc;

font-size:13px;

}

.upload-status{

font-size:13px;

color:#aaa;

text-align:right;

margin-top:-6px;

margin-bottom:6px;

}


/* ========================================================
   ============  تحسين بصري شامل (Polish Pass)  ============
   تحسينات بصرية فقط: ألوان، ظلال، حركات، طبقات — بدون أي
   تعديل على منطق أو سلوك اللعبة أو أسماء العناصر الوظيفية
======================================================== */

:root{

--bg-deep:#0b0b0f;
--bg-panel:#16161d;
--bg-panel-2:#1c1c24;
--line-soft: rgba(255,255,255,0.08);
--line-strong: rgba(255,255,255,0.16);
--accent-gold:#e8b93f;
--accent-blue:#3b82ff;
--accent-red:#ff3b3b;
--accent-green:#35c46b;
--text-dim:#9a9aa5;
--shadow-deep: 0 8px 24px rgba(0,0,0,0.45);
--radius-lg:16px;
--radius-md:12px;

}


/* خلفية عامة أكثر عمقًا بدل الأسود المسطح */

body{

background:
radial-gradient(circle at 15% 0%, rgba(59,130,255,0.07), transparent 40%),
radial-gradient(circle at 85% 100%, rgba(232,185,63,0.06), transparent 45%),
var(--bg-deep);

font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;

-webkit-font-smoothing: antialiased;

}


/* ========================================
   الشريط العلوي — تحسين
======================================== */

.top-bar{

background: linear-gradient(180deg, #1a1a22, #131318);

border-bottom: 1px solid var(--line-soft);

box-shadow: 0 4px 18px rgba(0,0,0,0.35);

backdrop-filter: blur(6px);

}

.game-title{

background: linear-gradient(135deg, #fff, #b9b9c6);

-webkit-background-clip:text;

background-clip:text;

color:transparent;

letter-spacing:.3px;

}

.player-info{

color:#cfcfd8;

}


/* ========================================
   العناوين — تحسين طباعي
======================================== */

h1{

font-weight:800;

letter-spacing:.2px;

text-shadow: 0 2px 12px rgba(0,0,0,0.4);

}

h2{

font-weight:700;

position:relative;

display:inline-block;

}

.subtitle{

color: var(--text-dim);

font-size:14px;

line-height:1.6;

}


/* ========================================
   الأزرار — قاعدة عامة أكثر احترافية
======================================== */

button{

background: linear-gradient(160deg, #24242e, #17171d);

border: 1px solid var(--line-soft);

border-radius: var(--radius-md);

box-shadow: 0 4px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.04);

transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;

font-weight:600;

letter-spacing:.2px;

}

button:active{

transform: scale(0.96);

box-shadow: 0 2px 6px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);

filter:brightness(0.92);

}

button:disabled,
button.on-cooldown{

filter:grayscale(.25) brightness(.75);

}


/* القائمة الرئيسية: أزرار بطاقية بلمسة ذهبية خفيفة */

.menu button{

position:relative;

padding:18px 16px;

text-align:right;

overflow:hidden;

background: linear-gradient(160deg, #202028, #15151b);

border: 1px solid var(--line-soft);

}

.menu button::before{

content:"";

position:absolute;

inset:0;

background: linear-gradient(120deg, transparent 40%, rgba(255,255,255,0.05) 50%, transparent 60%);

transform: translateX(-100%);

transition: transform .5s ease;

}

.menu button:active::before{

transform: translateX(100%);

}

.menu button:active{

border-color: rgba(232,185,63,0.35);

}


/* ========================================
   البطاقات: character-card / admin-card / form-box / request
======================================== */

.character-card,
.admin-card,
.form-box,
.request-character-box{

background: linear-gradient(160deg, var(--bg-panel-2), var(--bg-panel));

border: 1px solid var(--line-soft);

border-radius: var(--radius-lg);

box-shadow: var(--shadow-deep);

}

.character-card:active,
.admin-card:active{

border-color: rgba(232,185,63,0.3);

box-shadow: 0 4px 14px rgba(0,0,0,0.5);

}

.empty-card{

border: 1px dashed var(--line-strong);

border-radius: var(--radius-lg);

color: var(--text-dim);

background: rgba(255,255,255,0.02);

}

.solo-buttons{

gap:12px;

}


/* ========================================
   ⚡ زر الهجوم أثناء "الشلل" (التهدئة/القفل)
   بدل التعتيم الرمادي الباهت: تأثير برق كهربائي واضح
   يوضّح أن الزر مقفل مؤقتًا وليس معطّلاً بشكل دائم
======================================== */

#pve-attack-button.locked,
#pvp-attack-button.locked{

animation: none;

background:
radial-gradient(circle, #2a2f3a, #14161c);

box-shadow:
0 0 0 2px rgba(120,170,255,0.25) inset,
0 0 18px rgba(80,140,255,0.25);

opacity:1;

position:relative;

overflow:visible;

}

/* شرارات برق دوارة حول محيط الزر */

#pve-attack-button.locked::before,
#pvp-attack-button.locked::before{

content:"";

position:absolute;

inset:-6px;

border-radius:50%;

border:2px solid transparent;

border-top-color: rgba(140,190,255,0.9);

border-left-color: rgba(140,190,255,0.35);

filter: drop-shadow(0 0 6px rgba(120,170,255,0.8));

animation: lockSpin 1.1s linear infinite;

}

/* وميض برق داخلي متقطع (مثل شحنة كهربائية تتراكم) */

#pve-attack-button.locked::after,
#pvp-attack-button.locked::after{

content:"⚡";

position:absolute;

inset:0;

display:flex;

align-items:center;

justify-content:center;

font-size:26px;

color:#bcd8ff;

text-shadow:
0 0 8px rgba(140,190,255,1),
0 0 18px rgba(90,150,255,0.8);

animation: lockFlicker 0.9s steps(1,end) infinite;

}

@keyframes lockSpin{
0%{ transform: rotate(0deg); }
100%{ transform: rotate(360deg); }
}

@keyframes lockFlicker{
0%, 100%{ opacity:1; }
8%{ opacity:0.2; }
16%{ opacity:1; }
40%{ opacity:1; }
48%{ opacity:0.15; }
54%{ opacity:1; }
78%{ opacity:0.3; }
84%{ opacity:1; }
}


/* ========================================
   المهارات المقفلة بالتهدئة: نفس روح البرق لكن أخف
   (شارة التهدئة الرقمية تبقى كما هي دون تغيير وظيفي)
======================================== */

.skills-page button.on-cooldown{

position:relative;

}

.skills-page button.on-cooldown::after{

content:"";

position:absolute;

inset:0;

border-radius:inherit;

background: linear-gradient(115deg, transparent 40%, rgba(140,190,255,0.08) 50%, transparent 60%);

background-size:250% 100%;

animation: cooldownSheen 2.2s linear infinite;

pointer-events:none;

}

@keyframes cooldownSheen{
0%{ background-position: 150% 0; }
100%{ background-position: -150% 0; }
}


/* ========================================
   النوافذ المنبثقة (السرقة / تفاصيل المهارة)
======================================== */

.steal-modal{

background: rgba(5,5,8,0.7);

backdrop-filter: blur(4px);

animation: modalFadeIn .2s ease;

}

@keyframes modalFadeIn{
from{ opacity:0; }
to{ opacity:1; }
}

.steal-modal-box{

background: linear-gradient(160deg, #1c1c24, #121216);

border: 1px solid var(--line-soft);

box-shadow: var(--shadow-deep), 0 0 40px rgba(59,130,255,0.06);

animation: modalPopIn .25s cubic-bezier(.2,.9,.3,1.2);

}

@keyframes modalPopIn{
from{ opacity:0; transform: scale(.92) translateY(6px); }
to{ opacity:1; transform: scale(1) translateY(0); }
}


/* ========================================
   سجل أحداث المعركة — رسائل أوضح
======================================== */

.log-toggle-btn{

background: linear-gradient(160deg,#1c1c24,#131318);

border: 1px solid var(--line-soft);

font-weight:600;

}

.battle-log{

background: linear-gradient(180deg, #0e0e13, #0a0a0d);

border: 1px solid var(--line-soft);

box-shadow: inset 0 2px 10px rgba(0,0,0,0.4);

line-height:1.9;

}


/* ========================================
   حاوية المهارات وشرائح المهارات المستخدمة — تناسق أدق
======================================== */

.skills-container{

background: rgba(255,255,255,0.015);

border-radius: var(--radius-md);

}

.used-skill-chip{

box-shadow: 0 2px 8px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.03);

}


/* ========================================
   نظام الإشعارات الاحترافي (Toast) — بديل alert() الأبيض
======================================== */

#toast-container{

position:fixed;

top:calc(env(safe-area-inset-top, 0px) + 14px);

left:50%;

transform:translateX(-50%);

z-index:500;

display:flex;

flex-direction:column;

gap:10px;

width:92%;

max-width:420px;

pointer-events:none;

}

.app-toast{

pointer-events:auto;

display:flex;

align-items:center;

gap:10px;

padding:14px 16px;

border-radius:14px;

background: linear-gradient(160deg, #1e1e26, #131318);

border:1px solid var(--line-soft, rgba(255,255,255,0.08));

box-shadow: 0 10px 30px rgba(0,0,0,0.5);

color:#f0f0f5;

font-size:14px;

font-weight:600;

line-height:1.5;

text-align:right;

opacity:0;

transform: translateY(-16px) scale(0.96);

transition: opacity .25s ease, transform .25s cubic-bezier(.2,.9,.3,1.2);

cursor:pointer;

}

.app-toast.show{

opacity:1;

transform: translateY(0) scale(1);

}

.app-toast.hide{

opacity:0;

transform: translateY(-10px) scale(0.97);

}

.app-toast-icon{

font-size:18px;

flex-shrink:0;

}

.app-toast-text{

flex:1;

}

.app-toast.success{

border-color: rgba(53,196,107,0.4);

box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 0 1px rgba(53,196,107,0.15) inset;

}

.app-toast.success .app-toast-icon{

filter: drop-shadow(0 0 6px rgba(53,196,107,0.8));

}

.app-toast.error{

border-color: rgba(255,59,59,0.4);

box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,59,59,0.15) inset;

}

.app-toast.error .app-toast-icon{

filter: drop-shadow(0 0 6px rgba(255,59,59,0.8));

}

.app-toast.info{

border-color: rgba(59,130,255,0.35);

box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 0 1px rgba(59,130,255,0.12) inset;

}


/* ========================================
   مؤشر بصري خفيف على المقاتل المجمّد (حالة الشلل/التجميد)
======================================== */

.battle-image.frozen-status{

filter: grayscale(.35) brightness(1.05) saturate(1.1);

box-shadow: 0 0 0 3px rgba(140,210,255,0.55), 0 0 22px rgba(120,190,255,0.55);

}
