/* 
   style.css
   عجلة الحظ الاحترافية لـ Telegram WebApp
   مؤثرات متناسقة وألوان فاخرة (Casino Style)
*/

:root {
    --gold-gradient: linear-gradient(135deg, #FFE07D 0%, #B8860B 50%, #FFE07D 100%);
    --metallic-silver: linear-gradient(135deg, #E0E0E0 0%, #8A8A8A 50%, #E0E0E0 100%);
    --bg-dark: #0B0B0E;
    --card-dark: #141419;
    --accent-red: #E21B3C;
    --accent-gold: #FFD700;
    --text-white: #FFFFFF;
    --shadow-color: rgba(0, 0, 0, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', 'Montserrat', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-dark);
    color: var(--text-white);
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: 
        radial-gradient(circle at 50% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(226, 27, 60, 0.1) 0%, transparent 60%);
}
/* !========================================== */

/* شريط الأرباح الكلية فوق العجلة */
.total-winnings-banner {
    background: linear-gradient(135deg, #111827, #1f2937);
    border: 2px solid #111a17; /* لون أخضر جذاب يوحي بالأرباح الجماعية */
    border-radius: 12px;
    padding: 10px 20px;
    color: #fff;
    font-weight: bold;
    text-align: center;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
    margin-bottom: 20px;
}
.total-winnings-banner span {
    color: #10b981;
    font-size: 18px;
}




/* !-------------------------------------------- */
/* حاوية العنوان العلوية */
.bot-title-container {
    text-align: center;
    margin-top: 5px;
    margin-bottom: 5px;
}

/* تنسيق اسم البوت المزخرف والكبير */
.bot-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0;
    border-radius: 12px;
    
    /* نص متدرج باللون الذهبي البراق */
    background: linear-gradient(135deg, #07152e 0%, #639663 50%, #373b3b 100%);
    --webkit-background-clip: text;
    --webkit-text-fill-color: transparent;
    
    /* توهج ضوئي خلف الاسم */
    filter: drop-shadow(0 0 12px rgba(14, 14, 46, 0.4));
    
    /* زينة خفيفة حول النص */
    position: relative;
    display: inline-block;
}

/* إضافة خط فاصل زمني مزخرف صغير تحت الاسم */
.bot-title::after {
    content: '';
    display: block;
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #f8f8f7, transparent);
    margin: 4px auto 0 auto;
    border-radius: 2px;
}

/* شريط الأرباح العامة (مرتب ومناسب ليكون أسفل العنوان) */
.total-winnings-banner {
    background: linear-gradient(135deg, #111827, #1f2937);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 12px;
    padding: 8px 16px;
    color: #e2e8f0;
    font-weight: bold;
    text-align: center;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin: 0 auto 20px auto;
    width: fit-content;
}



.total-winnings-banner span {
    color: #10b981;
    font-size: 16px;
    margin-right: 9px;
}



.live-ticker-container {
    background: linear-gradient(135deg, #0b1d17, #051224);
    border: 2px solid #1b3a30; /* لون أخضر جذاب يوحي بالأرباح الجماعية */
    border-radius: 12px;
    padding: 10px 20px;
    color: #fff;
    font-weight: bold;
    text-align: center;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
    margin-bottom: 15px;
}

.ticker-wrapper {
    
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    
}

.ticker-badge {
    color: #f59e0b;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.ticker-text {
    
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 500;
    transition: opacity 0.2s ease-in-out; /* حركة ناعمة عند التبديل */
    white-space: nowrap;
    
}

.ticker-text b {
    color: #23a77b;
}









.app-container {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1px;
    position: relative;
}
/* بدنا نعدل هون مشان البطاقة الخارجيه */
/* الترويسة وبطاقة الرصيد */
.app-header {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    background: rgba(20, 20, 25, 0.85);
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 215, 0, 0.15);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent-gold);
    object-fit: cover;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.user-info {
    display:flex;
    flex-direction: column;
}

.username {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-white);
}

.rank {
    font-size: 10px;
    color: var(--accent-gold);
}

.balance-card {
    display:table-column;
    flex-direction: column;
    align-items: flex-end;
}

.balance-label {
    font-size: 14px;
    color: #8E8E93;
}

.balance-value {
    font-size: 16px;
    font-weight: 900;
    color: #4CD964;
    font-family: 'Montserrat', sans-serif;
}

/* منطقة عجلة الحظ الاحترافية */
.wheel-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 2px 0;
}

.wheel-outer-wrapper {
    position: relative;
    width: 340px;
    height: 340px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* مؤشر عجلة الحظ الاحترافي */
.wheel-pointer {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 42px;
    z-index: 10;
    background: var(--gold-gradient);
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
    border-radius: 4px;
}

.wheel-pointer::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #b97070;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* حركة تذبذب خفيفة للمؤشر عند الاحتكاك بالقطاعات */
@keyframes pointer-tick {
    0% { transform: translateX(-50%) rotate(0deg); }
    30% { transform: translateX(-50%) rotate(-18deg); }
    70% { transform: translateX(-50%) rotate(5deg); }
    100% { transform: translateX(-50%) rotate(0deg); }
}

.wheel-pointer.ticking {
    animation: pointer-tick 0.1s ease-out;
}

/* الإطار الخارجي الفاخر */
.wheel-frame {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    padding: 10px; /* مسافة الإطار الذهبي */
    background: radial-gradient(circle, #2E2512 0%, #151108 70%, #000000 100%);
    border: 5px solid #FFD700;
    box-shadow: 
        0 0 35px rgba(212, 175, 55, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.8);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* مصابيح LED الدائرية */
.led-lights {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}

.led-bulb {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #FFF;
    box-shadow: 0 0 6px #FFF;
    transform-origin: center;
    top: calc(50% - 4px);
    left: calc(50% - 4px);
}

/* أنماط إضاءة مختلفة للـ LED */
@keyframes led-flash-even {
    0%, 100% { background: #00b7ff; box-shadow: 0 0 10px #FFD700, 0 0 20px #FFD700; }
    50% { background: #444; box-shadow: none; }
}

@keyframes led-flash-odd {
    0%, 100% { background: #ee82e9; box-shadow: none; }
    50% { background: #FFF; box-shadow: 0 0 10px #FFF, 0 0 20px #FFF; }
}

.led-bulb.even {
    animation: led-flash-even 0.8s infinite;
}

.led-bulb.odd {
    animation: led-flash-odd 0.8s infinite;
}

/* العجلة الداخلية والقماش الدوار */
.wheel-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
    z-index: 1;
}

#wheel-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* زر الدوران الموضع بدقة فائقة في منتصف العجلة */
.spin-button {
    position: absolute;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--gold-gradient);
    border: 4px solid #111;
    z-index: 5;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 
        0 6px 15px rgba(0, 0, 0, 0.6),
        0 0 25px rgba(255, 215, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #111;
    transition: all 0.15s ease-in-out;
}

.spin-button:active {
    transform: translate(-50%, -50%) scale(0.92);
    box-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.6),
        inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.spin-button::before {
    content: '';
    position: absolute;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 215, 0, 0.4);
    pointer-events: none;
    animation: spin-pulse 3s linear infinite;
}

@keyframes spin-pulse {
    0% { transform: rotate(0deg) scale(1); opacity: 0.8; }
    50% { transform: rotate(180deg) scale(1.04); opacity: 1; }
    100% { transform: rotate(360deg) scale(1); opacity: 0.8; }
}

.spin-text-en {
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 1px;
    line-height: 1.1;
    font-family: 'Montserrat', sans-serif;
}

.spin-text-ar {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.1;
}

/* الفوتر للتوجيهات */
.app-footer {
    width: 100%;
}

/* *هادا ل النافذة يلي تحت اخر شي..أدر العجله....الخ */
.tip-box {
    background: rgba(20, 20, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-radius: 12px;
    text-align: center;
}
/* *هادا ل القوس يلي حواليها */
.tip-box p {
    font-size: 14px;
    color: #A4A4AB;
    line-height: 1.6;
    font-weight: bold;
}

/* .ticker-badge {
    color: #f59e0b;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
} */

/* نافذة الفوز الفخمة */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: radial-gradient(circle at 50% 0%, #1c1c24 0%, #0d0d12 100%);
    width: 88%;
    max-width: 360px;
    border-radius: 24px;
    border: 2px solid var(--accent-gold);
    padding: 30px 20px;
    text-align: center;
    position: relative;
    transform: scale(0.7);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 15px 40px rgba(0,0,0,0.8), 0 0 30px rgba(212, 175, 55, 0.25);
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-glow {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    background: var(--accent-gold);
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
}

.ribbon {
    background: var(--accent-red);
    color: #FFF;
    padding: 6px 20px;
    font-weight: 900;
    font-size: 14px;
    border-radius: 30px;
    display: inline-block;
    margin-bottom: 16px;
    box-shadow: 0 4px 10px rgba(226, 27, 60, 0.4);
    border: 1px solid rgba(255,255,255,0.2);
}

.modal-title {
    font-size: 18px;
    color: #ECE9F2;
    margin-bottom: 10px;
    font-weight: 700;
}

.prize-display {
    font-size: 38px;
    font-weight: 900;
    color: var(--accent-gold);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    margin: 15px 0;
    font-family: 'Montserrat', sans-serif;
    animation: float-prize 1.5s ease-in-out infinite alternate;
}

@keyframes float-prize {
    0% { transform: translateY(0); }
    100% { transform: translateY(-6px); }
}

.modal-desc {
    color: #A4A4AB;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.modal-close-btn {
    width: 100%;
    background: var(--gold-gradient);
    color: #111;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    transition: transform 0.2s;
}

.modal-close-btn:active {
    transform: scale(0.97);
}

/* تأثير جزيئات العملات المتساقطة */
.coin-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.coin-particle {
    position: absolute;
    background: #FFD700;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.8);
    animation: fall-down var(--d) linear forwards;
}

@keyframes fall-down {
    0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(350px) rotate(360deg); opacity: 0; }
}

/* 🔴 تنسيق زر الدوران عند نفاد الرصيد */
.spin-button.btn-no-balance {
    background: linear-gradient(135deg, #2b3340 0%, #151b26 100%) !important;
    color: #6b7280 !important;
    border-color: #374151 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    opacity: 0.8;
    filter: grayscale(70%);
}

.spin-button.btn-no-balance::before {
    animation: none !important; /* إيقاف التوهج عند تعطيل الزر */
    border-color: rgba(255, 255, 255, 0.1) !important;
}


/*! 🖼️ طبقة الصورة خلف العجلة بتباين خفيف */ مهم جداااااااا.ما زبطت طلعت بنص قرص العجله
.wheel-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* 👈 التحكم بحدة التباين والشفافية */
    opacity: 0.22;                      /* درجة الشفافية (خفيفة لعدم التغطية على النصوص) */
    filter: contrast(130%) brightness(90%); /* ضبط التباين والإضاءة */
    
    z-index: 0;                         /* البقاء تحت الـ Canvas */
    pointer-events: none;               /* عدم إعاقة الضغط أو اللمس */
}




/* 🌐 خلفية الشاشة الكاملة بتباين وشفافية خفيفة */
.full-screen-bg {
    position: fixed;
    top: 0;
    left: 0;
    
    width: 120vw;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* 👈 يمكنك التحكم بدرجة الشفافية والتباين للشاشة كلها من هنا: */
    opacity: 0.30;                          /* الشفافية (0.10 إلى 0.20 ممتازة جداً للخلفيات) */
    filter: contrast(170%) brightness(80%);  /* حدة التباين والإضاءة */
    
    z-index: -1;                            /* يضمن بقاء الصورة خلف كافة عناصر التطبيق */
    pointer-events: none;
}


