            /* إلغاء التحديد الأزرق عند الضغط في جميع الصفحات */
        * {
          -webkit-tap-highlight-color: transparent;
          /* للموبايل (Chrome, Safari) */
          -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
          /* زيادة تأكيد للموبايل */
        }

        /* إلغاء الإطار الأزرق (Outline) الذي يظهر عند الضغط بالماوس أو الكيبورد */
        *:focus {
          outline: none !important;
        }

        /* منع اختيار النصوص في الأزرار ليعطي إحساس تطبيق حقيقي */
        button,
        .menu-btn,
        .choice-card,
        .menu-card {
          user-select: none;
          -webkit-user-select: none;
        }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
    }

    :root {
      --primary: #1A3A5F;
      --secondary: #D4AF37;
      --bg-app: #F0F4F8;
      --card-white: #FFFFFF;
      --text-main: #333333;
      --text-muted: #6C757D;
    }

    body {
      background: #E2E8EF;
      font-family: 'Cairo', sans-serif;
      display: flex;
      justify-content: center;
      min-height: 100vh;
    }

    .app-container {
      background: var(--bg-app);
      width: 100%;
      max-width: 414px;
      min-height: 100vh;
      padding: 20px 15px 110px;
      position: relative;
      overflow-x: hidden;
    }

    /* ===== HEADER ===== */
    .main-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
    }

    .back-btn-modern {
      background: var(--card-white);
      color: var(--primary);
      border: 1.5px solid #ddd;
      padding: 8px 16px;
      border-radius: 20px;
      font-weight: 700;
      font-size: 0.9rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 8px;
      font-family: 'Cairo', sans-serif;
      transition: all 0.2s;
    }

    .back-btn-modern:active {
      transform: scale(0.95);
      background: #f0f0f0;
    }

    .points-badge {
      background: #FFF8DC;
      color: #856404;
      padding: 6px 14px;
      border-radius: 20px;
      font-size: 0.9rem;
      font-weight: 800;
      display: flex;
      align-items: center;
      gap: 6px;
      border: 1px solid var(--secondary);
    }

    /* ===== TASBIH AREA ===== */
    .tasbih-area {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }

    #current-dhikr {
      font-size: 2.2rem;
      color: var(--primary);
      font-weight: 800;
      min-height: 60px;
      margin-bottom: 20px;
      text-align: center;
      transition: 0.4s ease;
    }

    .dhikr-change {
      transform: translateY(-20px);
      opacity: 0;
    }

    /* ===== MODE SWITCHER ===== */
    .mode-switcher {
      display: flex;
      background: var(--card-white);
      border-radius: 30px;
      padding: 5px;
      margin-bottom: 30px;
      box-shadow: 0 4px 10px rgba(0,0,0,0.05);
      border: 1px solid #e1e6ed;
      width: 100%;
      max-width: 280px;
    }

    .mode-btn {
      flex: 1;
      padding: 10px;
      border: none;
      background: transparent;
      border-radius: 25px;
      font-family: 'Cairo', sans-serif;
      font-weight: 700;
      font-size: 0.9rem;
      color: var(--text-muted);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      transition: all 0.3s ease;
    }

    .mode-btn.active {
      background: var(--primary);
      color: white;
      box-shadow: 0 4px 12px rgba(26,58,95,0.25);
    }

    /* ===== MODE 1: TAP (الدوس) ===== */
    .tasbih-circle {
      width: 280px;
      height: 280px;
      border-radius: 50%;
      background: var(--card-white);
      border: 14px solid var(--secondary);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      margin: 0 auto;
      box-shadow: 0 15px 35px rgba(212, 175, 55, 0.25);
      cursor: pointer;
      position: relative;
      animation: pulse-border 2.5s infinite;
      transition: transform 0.1s;
    }

    .tasbih-circle:active {
      transform: scale(0.92);
    }

    @keyframes pulse-border {
      0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
      70% { box-shadow: 0 0 0 25px rgba(212, 175, 55, 0); }
      100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
    }

    /* ===== MODE 2: BEADS (المسبحة) ===== */
    .beads-wrapper {
      display: none; /* مخفي افتراضياً */
      flex-direction: column;
      align-items: center;
      width: 100%;
      height: 280px;
    }

    .beads-counter-info {
      text-align: center;
      margin-bottom: 20px;
    }

    .beads-container {
      position: relative;
      height: 180px; 
      width: 100px;
      display: flex;
      justify-content: center;
      overflow: hidden;
      margin-top: 10px;
    }

    .bead-string {
      position: absolute;
      top: -20px;
      bottom: -20px;
      width: 6px;
      background: linear-gradient(to right, #b8860b, #ffd700, #b8860b);
      border-radius: 3px;
      z-index: 1;
    }

    .bead {
      position: absolute;
      top: 10px;
      width: 70px;
      height: 90px;
      border-radius: 50px;
      background: radial-gradient(circle at 30% 30%, #315e8f 0%, #1A3A5F 100%);
      box-shadow: 0 10px 15px rgba(0,0,0,0.4), inset 0 -5px 15px rgba(0,0,0,0.5), inset 0 5px 10px rgba(255,255,255,0.2);
      z-index: 2;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: transform 0.1s;
    }
    
    .bead:active {
      transform: scale(0.95);
    }

    /* أجزاء الزينة للمسبحة (الفواصل الذهبية) */
    .bead::before, .bead::after {
      content: '';
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      width: 24px;
      height: 8px;
      background: var(--secondary);
      border-radius: 50%;
      z-index: 3;
    }
    .bead::before { top: -4px; }
    .bead::after { bottom: -4px; }

    /* حركـة سحب الخرزة */
    .animating-bead {
      animation: dropBead 0.3s ease-in forwards;
      pointer-events: none;
    }

    @keyframes dropBead {
      0% { transform: translateY(0) scale(0.95); opacity: 1; }
      100% { transform: translateY(120px) scale(1.05); opacity: 0; }
    }

    /* ===== COUNTER TYPOGRAPHY (Shared) ===== */
    .counter-val {
      font-size: 5.5rem;
      font-weight: 800;
      color: var(--primary);
      line-height: 1;
      transition: transform 0.1s;
    }

    .beads-wrapper .counter-val {
      font-size: 4rem; /* أصغر قليلاً في وضع المسبحة */
    }

    .bump {
      transform: scale(1.15);
      color: var(--secondary);
    }

    .sub-label-text {
      font-size: 1.2rem;
      color: var(--text-muted);
      font-weight: 700;
      margin-top: 10px;
      background: #EEF2F7;
      padding: 4px 15px;
      border-radius: 20px;
      display: inline-block;
    }

    /* ===== CONTROLS ===== */
    .controls {
      margin-top: 30px;
      display: flex;
      justify-content: center;
      width: 100%;
    }

    .reset-btn {
      background: none;
      border: 1.5px dashed #ccc;
      color: var(--text-muted);
      padding: 10px 20px;
      border-radius: 20px;
      font-weight: 700;
      font-size: 0.9rem;
      cursor: pointer;
      font-family: 'Cairo', sans-serif;
      display: flex;
      align-items: center;
      gap: 6px;
      transition: all 0.2s;
    }

    .reset-btn:hover, .reset-btn:active {
      background: #fee;
      border-color: #f66;
      color: #d32f2f;
    }

    /* ===== BOTTOM NAV ===== */
    .bottom-nav {
      position: fixed;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 100%;
      max-width: 414px;
      background: white;
      display: flex;
      justify-content: space-around;
      padding: 12px 0;
      box-shadow: 0 -4px 20px rgba(0,0,0,0.07);
      z-index: 100;
      border-radius: 24px 24px 0 0;
    }
    .nav-item {
      text-decoration: none;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 3px;
      color: var(--text-muted);
      font-size: 0.65rem;
      font-weight: 700;
      font-family: 'Cairo', sans-serif;
    }
    .nav-item i { font-size: 1.25rem; }
    .nav-item.active { color: var(--secondary); }

    /* ===== MODAL (نافذة التمام المائة) ===== */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.6);
      z-index: 500;
      display: none;
      align-items: flex-end;
      justify-content: center;
      backdrop-filter: blur(3px);
    }
    .modal-overlay.open {
      display: flex;
    }
    .modal-sheet {
      background: white;
      width: 100%;
      max-width: 414px;
      border-radius: 30px 30px 0 0;
      padding: 24px 24px 40px;
      animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      text-align: center;
      box-shadow: 0 -10px 20px rgba(0,0,0,0.1);
    }
    @keyframes slideUp {
      from { transform: translateY(100%); }
      to { transform: translateY(0); }
    }
    .modal-handle {
      width: 50px;
      height: 5px;
      background: #ddd;
      border-radius: 5px;
      margin: 0 auto 20px;
    }
    .modal-icon {
      font-size: 4rem;
      margin-bottom: 15px;
      display: block;
      animation: bounce 1s infinite alternate;
    }
    @keyframes bounce {
      from { transform: translateY(0); }
      to { transform: translateY(-10px); }
    }
    .modal-title {
      font-weight: 800;
      color: var(--secondary);
      font-size: 1.5rem;
      margin-bottom: 10px;
    }
    .modal-text {
      color: var(--primary);
      font-weight: 700;
      font-size: 1rem;
      margin-bottom: 15px;
    }
    .dua-box {
      background: var(--bg-app);
      border: 2px solid var(--secondary);
      padding: 15px;
      border-radius: 16px;
      color: var(--primary);
      font-weight: 800;
      font-size: 1.1rem;
      line-height: 1.6;
      margin-bottom: 20px;
    }
    .dua-reward {
      color: #2E7D32;
      font-weight: 800;
      font-size: 0.95rem;
      margin-bottom: 25px;
      background: #E8F5E9;
      padding: 8px;
      border-radius: 12px;
    }
    .modal-save-btn {
      width: 100%;
      padding: 16px;
      background: var(--primary);
      color: white;
      border: none;
      border-radius: 16px;
      font-family: 'Cairo', sans-serif;
      font-size: 1.1rem;
      font-weight: 800;
      cursor: pointer;
      box-shadow: 0 5px 15px rgba(26,58,95,0.3);
      transition: 0.2s;
    }
    .modal-save-btn:active {
      transform: scale(0.96);
    }

    /* 1. توحيد الخلفية وإلغاء التوسيط الخارجي لتملأ الصفحة كامل الشاشة */
body {
    margin: 0;
    background: var(--bg-app, #F0F4F8); /* توحيد لون الخلفية لإخفاء الفراغات */
    font-family: 'Cairo', sans-serif;
    min-height: 100vh;
}

.app-container {
    background: var(--bg-app, #F0F4F8);
    width: 100%;
    max-width: 100%; /* إلغاء الحد الأقصى 414px لتمتد الشاشة بالكامل */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 120px; /* ترك مساحة كافية للقائمة السفلية دون تداخل */
    box-sizing: border-box;
}

/* 2. تنسيق محتوى السبحة والعداد للشاشات الكبيرة */
/* بنخلي الخلفية مفرودة بعرض الشاشة بالكامل، وبنحافظ على العداد والأزرار في المنتصف بشكل أنيق عشان متمطش */
@media (min-width: 768px) {
    /* العناصر الرئيسية داخل الصفحة (مثل كارت العداد، كروت الأدعية، الأزرار الكبيرة) */
    .main-card, .tasbih-card, .counter-section, .dhikr-box, .container-box {
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
    }
    
    /* إذا كانت الأذكار أو الخيارات تظهر تحت بعضها، تحول لشبكة متناسقة */
    .options-grid, .grid-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
        max-width: 800px;
        margin: 0 auto;
    }
}