:root {
      /* Tahannak palette */
      --bg-deep: #1a0a2e;
      --bg-mid: #22103a;
      --bg-card: #2d1a4a;
      --bg-card2: #381f58;
      --purple-vivid: #7c3aed;
      --purple-light: #a855f7;
      --purple-bright: #c084fc;
      --purple-glow: rgba(124, 58, 237, 0.45);
      --orange: #f59e0b;
      --orange-dark: #d97706;
      --orange-glow: rgba(245, 158, 11, 0.4);
      --white: #ffffff;
      --text-muted: #a78bca;
      --border: rgba(124, 58, 237, 0.3);
      --border-bright: rgba(168, 85, 247, 0.5);
      --radius: 18px;
      --radius-sm: 12px;
      /* Legacy aliases (lobby) */
      --primary-color: var(--purple-vivid);
      --primary-light: var(--purple-light);
      --primary-dark: #4c1d95;
      --secondary-color: var(--purple-bright);
      --accent-color: var(--orange);
      --accent-light: #fbbf24;
      --text-dark: #2c3e50;
      --text-light: #ffffff;
      --bg-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 45%, #c084fc 100%);
      --error-color: #ff4d4d;
      --glass-bg: rgba(255, 255, 255, 0.08);
      --glass-border: var(--border-bright);
      --success-color: #4caf50;
    }

    html {
      scroll-behavior: smooth;
    }

    /* ========== Orientation Lock - Portrait Only ========== */
    .orientation-warning {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(135deg, #1a0a2e 0%, #7c3aed 55%, #4c1d95 100%);
      z-index: 10000;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      color: white;
      text-align: center;
      padding: 20px;
      font-family: 'Cairo', sans-serif;
    }

    .orientation-warning.show {
      display: flex;
    }

    .orientation-warning-icon {
      font-size: 80px;
      margin-bottom: 30px;
      animation: rotate 2s linear infinite;
    }

    @keyframes rotate {
      from { transform: rotate(0deg); }
      to { transform: rotate(90deg); }
    }

    .orientation-warning h2 {
      font-size: 28px;
      margin-bottom: 15px;
      font-weight: 700;
    }

    .orientation-warning p {
      font-size: 18px;
      line-height: 1.6;
      max-width: 400px;
    }

    /* Hide main content when in landscape on mobile */
    @media screen and (max-width: 768px) and (orientation: landscape) {
      body > *:not(.orientation-warning) {
        display: none !important;
      }
      
      .orientation-warning {
        display: flex !important;
      }
    }
    
    /* ========== شريط العنوان العلوي ========== */
    .header-banner {
      position: fixed;
      top: 0;
      right: 0;
      left: 0;
      height: 80px;
      background: rgba(26, 10, 46, 0.55);
      backdrop-filter: blur(20px) saturate(1.4);
      -webkit-backdrop-filter: blur(20px) saturate(1.4);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      box-shadow: 0 4px 32px rgba(0, 0, 0, 0.45);
      z-index: 1000;
      border-bottom: 1px solid var(--border);
      transition: background 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
    }

    .header-banner.header-banner--scrolled {
      background: rgba(26, 10, 46, 0.92);
      box-shadow: 0 2px 32px rgba(0, 0, 0, 0.55);
      border-bottom-color: rgba(168, 85, 247, 0.35);
    }
    
    .header-content {
      display: flex;
      align-items: center;
      width: 100%;
      max-width: 100%;
      margin: 0 auto;
      gap: 12px;
      box-sizing: border-box;
      padding-inline-start: 40px;
      padding-inline-end: 10px;
    }

    .header-cluster--leading,
    .header-cluster--trailing {
      flex: 1 1 0;
      min-width: 0;
      display: flex;
      align-items: center;
    }

    .header-cluster--leading {
      justify-content: flex-start;
      gap: 14px;
    }

    .header-cluster--trailing {
      justify-content: flex-start;
      gap: 12px;
    }

    .header-logo-auth-wrap {
      display: flex;
      align-items: center;
      flex-shrink: 0;
      gap: 14px;
      min-width: 0;
    }
    
    .logo-container {
      display: flex;
      align-items: center;
      gap: 15px;
      text-decoration: none;
      transition: transform 0.3s ease;
      flex-shrink: 0;
    }
    
    .logo-container:hover {
      transform: translateY(-2px);
    }

    /* شارة حالة الاشتراك/التجربة بجانب زر الاشتراك في الهيدر (ديسكتوب فقط) */
    .subscription-status-badge {
      display: none;
      align-items: center;
      justify-content: center;
      padding: 7px 14px;
      margin-left: 8px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.18);
      border: 1px solid rgba(255, 255, 255, 0.35);
      color: #fff;
      font-size: 0.86rem;
      font-weight: 600;
      white-space: nowrap;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
      cursor: default;
    }

    .subscription-status-badge--trial {
      background: rgba(76, 175, 80, 0.18);
      border-color: rgba(76, 175, 80, 0.6);
    }

    .subscription-status-badge--no-games {
      background: rgba(244, 67, 54, 0.18);
      border-color: rgba(244, 67, 54, 0.6);
    }

    .subscription-status-badge--has-games {
      background: rgba(255, 193, 7, 0.18);
      border-color: rgba(255, 193, 7, 0.7);
    }
    
    .header-image {
      width: 64px;
      height: 64px;
      box-sizing: border-box;
      border-radius: 12px;
      object-fit: cover;
      border: 2px solid rgba(168, 85, 247, 0.45);
      box-shadow: 0 0 22px var(--purple-glow), 0 4px 16px rgba(0, 0, 0, 0.35);
      background: linear-gradient(135deg, #7c3aed, #4c1d95);
      padding: 3px;
      flex-shrink: 0;
      display: block;
    }
    
    .auth-section {
      display: flex;
      align-items: center;
      flex-shrink: 0;
    }
    
    .auth-buttons-header {
      display: flex;
      gap: 10px;
    }
    
    .auth-btn-header {
      background: rgba(124, 58, 237, 0.12);
      color: var(--white);
      border: 1.5px solid rgba(168, 85, 247, 0.4);
      border-radius: 24px;
      padding: 8px 16px;
      font-size: 0.9em;
      cursor: pointer;
      transition: all 0.22s ease;
      backdrop-filter: blur(10px);
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .auth-btn-header:hover {
      background: rgba(124, 58, 237, 0.22);
      border-color: var(--purple-light);
      transform: translateY(-2px);
      box-shadow: 0 4px 18px rgba(124, 58, 237, 0.25);
    }
    
    .user-info-header {
      display: none;
      align-items: center;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 25px;
      padding: 5px 15px;
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.2);
      gap: 10px;
    }
    
    .user-name-header {
      font-weight: 600;
      font-size: 0.95em;
      color: white;
      margin: 0;
    }

    .account-details-btn {
      background: rgba(255, 255, 255, 0.15);
      color: white;
      border: 1px solid rgba(255, 255, 255, 0.35);
      border-radius: 18px;
      padding: 4px 10px;
      font-size: 0.8em;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      transition: all 0.3s;
    }

    .account-details-btn i {
      font-size: 0.9em;
    }

    .account-details-btn:hover {
      background: rgba(255, 255, 255, 0.25);
      transform: translateY(-1px);
    }
    
    .logout-btn-header {
      background: transparent;
      color: white;
      border: 1px solid rgba(255, 255, 255, 0.3);
      border-radius: 15px;
      padding: 4px 10px;
      margin-right: 10px;
      font-size: 0.8em;
      cursor: pointer;
      transition: all 0.3s;
      display: flex;
      align-items: center;
      gap: 5px;
    }
    
    .logout-btn-header:hover {
      background: rgba(255, 255, 255, 0.15);
    }
    
    .nav-menu {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      gap: 8px 16px;
      flex: 0 0 auto;
      min-width: 0;
      max-width: min(760px, 46vw);
      margin: 0;
      direction: ltr;
    }

    .nav-cluster {
      display: flex;
      align-items: center;
      flex-wrap: nowrap;
      gap: 10px;
      direction: rtl;
    }

    .nav-item-single-line {
      white-space: nowrap;
      flex-shrink: 0;
    }

    .nav-cluster--start {
      justify-content: flex-end;
    }

    .nav-cluster--end {
      justify-content: flex-start;
    }
    
    .nav-item {
      color: var(--text-muted);
      text-decoration: none;
      font-weight: 600;
      font-size: 1em;
      padding: 8px 16px;
      border-radius: 24px;
      transition: color 0.2s ease, background 0.2s ease, transform 0.25s ease;
      position: relative;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .nav-item i {
      font-size: 1.1em;
    }
    
    .nav-item:hover {
      color: var(--white);
      background: rgba(124, 58, 237, 0.22);
      transform: translateY(-2px);
    }
    
    .nav-item.active {
      color: var(--accent-color);
      background: rgba(245, 158, 11, 0.12);
      font-weight: 700;
    }
    
    .nav-item:not(.nav-item--home).active::after {
      content: '';
      position: absolute;
      bottom: -5px;
      right: 50%;
      transform: translateX(50%);
      width: 30px;
      height: 3px;
      background: var(--accent-color);
      border-radius: 3px;
    }

    .nav-item--home {
      grid-column: 2;
      justify-self: center;
      font-size: 1.12em;
      font-weight: 800;
      padding: 10px 22px;
      border-radius: 28px;
      background: linear-gradient(
        155deg,
        rgba(124, 58, 237, 0.65) 0%,
        rgba(91, 33, 182, 0.75) 28%,
        rgba(56, 31, 88, 0.88) 52%,
        rgba(245, 158, 11, 0.32) 88%,
        rgba(168, 85, 247, 0.45) 100%
      );
      border: 1px solid rgba(168, 85, 247, 0.75);
      box-shadow:
        0 0 32px rgba(124, 58, 237, 0.55),
        0 0 48px rgba(245, 158, 11, 0.12),
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
      color: var(--white);
      letter-spacing: 0.02em;
    }

    .nav-home-label {
      background: linear-gradient(
        180deg,
        #fffef5 0%,
        #fde68a 22%,
        #f59e0b 55%,
        #c084fc 100%
      );
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      filter: drop-shadow(0 1px 10px rgba(124, 58, 237, 0.55));
    }

    .nav-item--home i {
      font-size: 1.15em;
      color: var(--accent-color);
      filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.55));
      -webkit-text-fill-color: initial;
    }

    .nav-item--home:hover {
      background: linear-gradient(
        155deg,
        rgba(124, 58, 237, 0.78) 0%,
        rgba(245, 158, 11, 0.22) 45%,
        rgba(56, 31, 88, 0.85) 72%,
        rgba(168, 85, 247, 0.5) 100%
      );
      border-color: rgba(245, 158, 11, 0.55);
      box-shadow:
        0 0 40px rgba(124, 58, 237, 0.6),
        0 0 36px rgba(245, 158, 11, 0.22),
        0 6px 22px rgba(0, 0, 0, 0.38);
      transform: translateY(-2px);
    }

    .nav-item--home:hover .nav-home-label {
      filter: drop-shadow(0 1px 12px rgba(245, 158, 11, 0.45));
    }

    .nav-item--home.active {
      background: linear-gradient(
        155deg,
        rgba(245, 158, 11, 0.35) 0%,
        rgba(124, 58, 237, 0.62) 38%,
        rgba(76, 29, 149, 0.82) 70%,
        rgba(168, 85, 247, 0.42) 100%
      );
      border-color: rgba(245, 158, 11, 0.72);
      box-shadow:
        0 0 42px rgba(245, 158, 11, 0.38),
        0 0 36px rgba(124, 58, 237, 0.45),
        inset 0 0 20px rgba(255, 255, 255, 0.06);
      font-weight: 800;
    }

    .nav-item--home.active::after {
      display: none;
    }

    /* روابط الجوال (نفس عناصر القائمة) */
    .mobile-nav-links {
      display: none;
      flex-direction: column;
      gap: 6px;
      padding: 14px 0 4px;
      margin-top: 12px;
      border-top: 1px solid rgba(168, 85, 247, 0.25);
    }

    .mobile-nav-item {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      padding: 12px 16px;
      border-radius: 16px;
      text-decoration: none;
      color: var(--text-muted);
      font-weight: 600;
      font-size: 1em;
      transition: background 0.2s ease, color 0.2s ease;
      border: 1px solid transparent;
    }

    .mobile-nav-item:hover {
      color: var(--white);
      background: rgba(124, 58, 237, 0.22);
    }

    .mobile-nav-item--home {
      font-weight: 800;
      color: var(--white);
      background: linear-gradient(
        155deg,
        rgba(124, 58, 237, 0.65) 0%,
        rgba(56, 31, 88, 0.85) 50%,
        rgba(245, 158, 11, 0.28) 100%
      );
      border-color: rgba(168, 85, 247, 0.6);
      box-shadow:
        0 0 24px rgba(124, 58, 237, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    .mobile-nav-item--home .nav-home-label {
      display: inline-block;
    }

    .mobile-nav-item-single-line {
      white-space: nowrap;
    }
    
    .user-section {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-inline-start: auto;
      flex-shrink: 0;
    }
    
    .subscribe-btn-header {
      background: linear-gradient(135deg, var(--orange), var(--orange-dark));
      color: white;
      border: none;
      border-radius: 30px;
      padding: 13px 22px;
      font-size: 1.05em;
      font-weight: 800;
      cursor: pointer;
      transition: all 0.25s ease;
      box-shadow: 0 4px 22px var(--orange-glow);
      display: inline-flex;
      align-items: center;
      gap: 8px;
      position: relative;
      overflow: hidden;
      letter-spacing: 0.3px;
      white-space: nowrap;
      flex-shrink: 0;
    }
    
    .subscribe-btn-header::before {
      content: '';
      position: absolute;
      top: 0;
      right: 0;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
      transform: translateX(-100%);
      transition: transform 0.5s ease;
    }
    
    .subscribe-btn-header:hover {
      transform: translateY(-3px);
      box-shadow: 0 8px 32px var(--orange-glow);
    }
    
    .subscribe-btn-header:hover::before {
      transform: translateX(0);
    }
    
    .subscribe-icon {
      font-size: 1.28em;
    }
    
    .mobile-menu-btn {
      display: none;
      background: transparent;
      color: white;
      border: none;
      font-size: 1.5em;
      cursor: pointer;
      padding: 10px;
    }

    /* Mobile Menu Dropdown */
    .mobile-menu-dropdown {
      display: none;
      position: fixed;
      top: 60px;
      left: 0;
      right: 0;
      background: linear-gradient(135deg, rgba(26, 10, 46, 0.98) 0%, rgba(45, 26, 74, 0.98) 100%);
      backdrop-filter: blur(20px) saturate(1.3);
      -webkit-backdrop-filter: blur(20px) saturate(1.3);
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
      z-index: 999;
      border-bottom: 1px solid var(--border);
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.3s ease;
    }

    .mobile-menu-dropdown.show {
      display: block;
      max-height: calc(100vh - 60px);
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }

    .mobile-menu-content {
      padding: 20px;
      direction: rtl;
    }

    .mobile-auth-section {
      margin-bottom: 15px;
    }

    .mobile-user-info {
      display: flex;
      flex-direction: column;
      gap: 10px;
      align-items: center;
    }

    .mobile-user-name {
      color: white;
      font-weight: 600;
      font-size: 1.1em;
      text-align: center;
    }

    .mobile-logout-btn {
      background: rgba(255, 255, 255, 0.15);
      color: white;
      border: 1px solid rgba(255, 255, 255, 0.3);
      border-radius: 15px;
      padding: 10px 20px;
      font-size: 0.9em;
      cursor: pointer;
      transition: all 0.3s;
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      justify-content: center;
    }

    .mobile-logout-btn:hover {
      background: rgba(255, 255, 255, 0.25);
    }

    .mobile-auth-buttons {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .mobile-login-btn,
    .mobile-signup-btn {
      background: rgba(255, 255, 255, 0.15);
      color: white;
      border: 1px solid rgba(255, 255, 255, 0.25);
      border-radius: 20px;
      padding: 12px 20px;
      font-size: 1em;
      cursor: pointer;
      transition: all 0.3s;
      backdrop-filter: blur(10px);
      font-weight: 500;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      width: 100%;
    }

    .mobile-login-btn:hover,
    .mobile-signup-btn:hover {
      background: rgba(255, 255, 255, 0.25);
      transform: translateY(-2px);
    }

    /* Mobile Challenges Section */
    .mobile-challenges-section {
      margin-top: 15px;
      border-top: 1px solid rgba(255, 255, 255, 0.2);
      padding-top: 15px;
    }

    .mobile-challenges-toggle-btn {
      background: rgba(255, 255, 255, 0.15);
      color: white;
      border: 1px solid rgba(255, 255, 255, 0.25);
      border-radius: 20px;
      padding: 12px 20px;
      font-size: 1em;
      cursor: pointer;
      transition: all 0.3s;
      backdrop-filter: blur(10px);
      font-weight: 500;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      width: 100%;
    }

    .mobile-challenges-toggle-btn:hover {
      background: rgba(255, 255, 255, 0.25);
      transform: translateY(-2px);
    }

    .mobile-challenges-toggle-btn i:last-child {
      transition: transform 0.3s ease;
    }

    .mobile-challenges-toggle-btn.active i:last-child {
      transform: rotate(180deg);
    }

    .mobile-challenges-list {
      margin-top: 10px;
      max-height: none;
      overflow: visible;
      transition: all 0.3s ease;
    }

    .mobile-saved-challenges {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .mobile-challenge-item {
      background: rgba(255, 255, 255, 0.1);
      padding: 15px;
      border-radius: 15px;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
      cursor: default;
      transition: all 0.3s;
      border-left: 4px solid var(--primary-color);
    }

    .mobile-challenge-item:hover {
      background: rgba(255, 255, 255, 0.15);
      transform: translateX(-5px);
      border-left-color: var(--accent-color);
    }

    .mobile-challenge-title {
      font-weight: bold;
      margin-bottom: 8px;
      color: var(--secondary-color);
      font-size: 1.1em;
    }

    .mobile-challenge-teams {
      font-size: 0.9em;
      color: #ddd;
      margin-bottom: 5px;
    }

    .mobile-challenge-date {
      font-size: 0.8em;
      color: #aaa;
      margin-bottom: 10px;
    }

    .mobile-challenge-actions {
      display: flex;
      gap: 8px;
      margin-top: 10px;
      flex-wrap: wrap;
    }

    /* نافذة خيارات تسجيل الدخول الرئيسية */
    .auth-modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(10, 5, 20, 0.82);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 2000;
    }

    .auth-modal {
      background: linear-gradient(145deg, var(--bg-card), var(--bg-deep));
      border-radius: 22px;
      padding: 30px 25px;
      width: 90%;
      max-width: 400px;
      box-shadow: 0 0 60px rgba(124, 58, 237, 0.35), 0 20px 50px rgba(0, 0, 0, 0.5);
      border: 1px solid rgba(168, 85, 247, 0.45);
      text-align: center;
    }

    .auth-modal h2 {
      margin-bottom: 10px;
      color: var(--text-light);
    }

    .auth-modal p {
      margin-bottom: 20px;
      color: #ddd;
      font-size: 0.95em;
    }

    .auth-modal-buttons {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .auth-modal-close {
      margin-top: 15px;
      background: transparent;
      border: none;
      color: #ccc;
      cursor: pointer;
      font-size: 0.9em;
      text-decoration: underline;
    }

    .mobile-action-btn {
      flex: 1;
      min-width: 120px;
      padding: 8px 12px;
      border: none;
      border-radius: 10px;
      font-size: 0.85em;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
    }

    .mobile-edit-btn {
      background: rgba(255, 193, 7, 0.2);
      color: #ffc107;
      border: 1px solid rgba(255, 193, 7, 0.4);
    }

    .mobile-edit-btn:hover {
      background: rgba(255, 193, 7, 0.3);
      transform: translateY(-2px);
    }

    .mobile-resume-btn {
      background: rgba(76, 175, 80, 0.2);
      color: #4caf50;
      border: 1px solid rgba(76, 175, 80, 0.4);
    }

    .mobile-resume-btn:hover {
      background: rgba(76, 175, 80, 0.3);
      transform: translateY(-2px);
    }

    /* زر «رؤية النتيجة» عند اكتمال التحدي 100% */
    .mobile-resume-btn.mobile-resume-btn-results {
      background: linear-gradient(135deg, rgba(251, 191, 36, 0.35) 0%, rgba(245, 158, 11, 0.28) 100%);
      color: #fef3c7;
      border: 1px solid rgba(251, 191, 36, 0.65);
      box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
      font-weight: 700;
    }

    .mobile-resume-btn.mobile-resume-btn-results:hover {
      background: linear-gradient(135deg, rgba(251, 191, 36, 0.5) 0%, rgba(245, 158, 11, 0.4) 100%);
      transform: translateY(-2px);
      box-shadow: 0 0 22px rgba(245, 158, 11, 0.35);
    }

    @media (min-width: 993px) {
      .mobile-menu-dropdown {
        display: none !important;
      }
    }
    
    /* شاشات عريضة متوسطة (~1480px): تقليل الهيدر حتى لا يتداخل قسم الحساب مع القائمة */
    @media (max-width: 1640px) {
      .header-content {
        gap: 8px;
        padding-inline-start: 28px;
        padding-inline-end: 12px;
      }

      .header-cluster--leading {
        gap: 10px;
      }

      .header-cluster--trailing {
        gap: 8px;
      }

      .logo-container {
        gap: 10px;
      }

      .header-logo-auth-wrap {
        gap: 10px;
      }

      .header-image {
        width: 56px;
        height: 56px;
      }

      .user-info-header {
        padding: 4px 10px;
        gap: 6px;
        border-radius: 20px;
      }

      .user-name-header {
        font-size: 0.82em;
        max-width: 10rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .account-details-btn {
        padding: 3px 8px;
        font-size: 0.72em;
        border-radius: 14px;
        gap: 4px;
      }

      .logout-btn-header {
        padding: 3px 8px;
        margin-right: 6px;
        font-size: 0.72em;
        gap: 4px;
      }

      .subscription-status-badge {
        padding: 6px 11px;
        font-size: 0.78rem;
        margin-left: 6px;
      }

      .nav-menu {
        gap: 5px 8px;
        max-width: min(620px, 40vw);
      }

      .nav-cluster {
        gap: 6px;
      }

      .nav-item {
        padding: 6px 10px;
        font-size: 0.85em;
        gap: 6px;
      }

      .nav-item i {
        font-size: 1em;
      }

      .nav-item--home {
        font-size: 0.98em;
        padding: 7px 14px;
        border-radius: 22px;
      }

      .nav-item--home i {
        font-size: 1.05em;
      }

      .subscribe-btn-header {
        padding: 10px 17px;
        font-size: 0.9em;
        border-radius: 26px;
      }

      .subscribe-icon {
        font-size: 1.02em;
      }
    }

    /* 993px–1280px (مثل 1221px): ضغط إضافي حتى لا يتداخل صندوق الحساب/الخروج مع القائمة الوسطى */
    @media (max-width: 1280px) and (min-width: 993px) {
      .header-content {
        gap: 5px;
        padding-inline-start: 14px;
        padding-inline-end: 8px;
      }

      .header-cluster--leading {
        gap: 6px;
      }

      .header-cluster--trailing {
        gap: 6px;
      }

      .header-logo-auth-wrap {
        gap: 6px;
        flex-shrink: 1;
        min-width: 0;
        align-items: center;
      }

      .auth-section {
        display: inline-flex;
        flex: 0 1 auto;
        width: auto;
        max-width: 100%;
        min-width: 0;
        margin-inline-end: 0;
      }

      .user-section {
        min-width: 0;
        flex-shrink: 1;
      }

      .user-info-header {
        display: grid !important;
        grid-template-columns: auto auto;
        grid-template-rows: auto auto;
        column-gap: 8px;
        row-gap: 6px;
        justify-content: center;
        justify-items: center;
        align-items: center;
        width: max-content !important;
        max-width: 100%;
        min-width: 0;
        padding: 4px 0;
        padding-inline-start: 0;
        border-radius: 16px;
        background: transparent;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
      }

      .user-name-header {
        grid-column: 1 / -1;
        grid-row: 1;
        margin: 0;
        text-align: center;
        font-size: 0.72em;
        max-width: 11rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .account-details-btn,
      .logout-btn-header {
        position: relative;
        padding: 3px 7px;
        font-size: 0.65em;
        gap: 2px;
        margin-right: 0;
        border-radius: 11px;
      }

      .logout-btn-header {
        grid-column: 1;
        grid-row: 2;
      }

      .account-details-btn {
        grid-column: 2;
        grid-row: 2;
      }

      .account-details-btn span,
      .logout-btn-header span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
      }

      .header-image {
        width: 54px;
        height: 54px;
      }

      .subscription-status-badge {
        padding: 4px 8px;
        font-size: 0.66rem;
        margin-left: 4px;
      }

      .nav-menu {
        gap: 5px 9px;
        max-width: min(560px, 35vw);
      }

      .nav-cluster {
        gap: 6px;
      }

      .nav-item {
        padding: 6px 11px;
        font-size: 0.82em;
        gap: 6px;
      }

      .nav-item i {
        font-size: 1.02em;
      }

      .nav-item--home {
        font-size: 0.94em;
        padding: 7px 15px;
        border-radius: 22px;
      }

      .nav-item--home i {
        font-size: 1.06em;
      }

      .subscribe-btn-header {
        padding: 8px 13px;
        font-size: 0.82em;
        border-radius: 22px;
        gap: 6px;
      }

      .subscribe-icon {
        font-size: 0.95em;
      }
    }
    
    /* ≤992px: هيدر بنفس تخطيط الجوال — لوجو بالمنتصف، همبرغر يسار، اشترك/الشارة حول اللوجو */
    @media (max-width: 992px) {
      .header-banner {
        height: 60px;
        padding: 0 5px;
      }

      .header-cluster--leading,
      .header-cluster--trailing {
        display: contents;
      }

      .header-logo-auth-wrap {
        display: contents;
      }

      .header-content {
        justify-content: space-between;
        gap: 5px;
        padding: 0;
        position: relative;
        width: 100%;
        max-width: 100%;
      }

      .nav-menu {
        display: none;
      }

      .mobile-nav-links {
        display: flex;
      }

      .mobile-menu-btn {
        display: block;
        flex-shrink: 0;
        padding: 8px;
        font-size: 1.2em;
        order: 1;
        position: absolute;
        left: 5px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 5;
      }

      .logo-container {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        order: 2;
        z-index: 1;
      }

      .header-image {
        width: 50px;
        height: 50px;
      }

      .subscription-status-badge {
        display: flex !important;
        position: absolute;
        right: 50%;
        top: 50%;
        transform: translate(calc(50% + min(292px, 41vw)), -50%);
        margin-left: 0;
        z-index: 1;
        font-size: clamp(0.62rem, 2.1vw, 0.78rem);
        padding: 6px 12px;
        max-width: min(280px, 52vw);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .auth-section {
        display: none !important;
      }

      .user-section {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(calc(-50% - min(108px, 15vw)), -50%);
        order: 4;
        flex-shrink: 0;
        gap: 0;
        z-index: 1;
        margin-inline-start: unset;
      }

      .subscribe-btn-header {
        padding: 8px;
        width: 40px;
        height: 40px;
        min-width: 40px;
        justify-content: center;
        white-space: normal;
      }

      .subscribe-icon {
        font-size: 1.15em;
      }

      .subscribe-btn-header span {
        display: none;
      }

      .auth-btn-header {
        padding: 6px;
        width: 32px;
        height: 32px;
        min-width: 32px;
        justify-content: center;
      }

      .auth-btn-header span {
        display: none;
      }

      .mobile-menu-dropdown {
        top: 60px;
      }
    }

    /* شاشات ضيقة جداً (مثل 492×837): تصغير شارة حالة الاشتراك قليلاً */
    @media (max-width: 492px) {
      .subscription-status-badge {
        font-size: clamp(0.46rem, 2.35vw, 0.55rem);
        padding: 3px 6px;
        max-width: min(200px, 52vw);
      }
    }
    
    body {
      font-family: 'Cairo', sans-serif;
      margin: 0;
      padding: 0;
      display: flex;
      background: var(--bg-deep);
      color: var(--text-light);
      padding-top: 80px;
      min-height: 100vh;
      overflow-x: hidden;
      position: relative;
    }

    /* خلفية كونية: إضاءة أوضح تحت/حول الهيدر، أغمق في منتصف الصفحة، لمعان في الزوايا */
    body::before {
      content: '';
      position: fixed;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      background:
        radial-gradient(ellipse 110% 60% at 50% -5%, rgba(124, 58, 237, 0.38) 0%, transparent 48%),
        radial-gradient(ellipse 90% 55% at 72% 12%, rgba(192, 132, 252, 0.22) 0%, transparent 52%),
        radial-gradient(ellipse 70% 60% at 10% 88%, rgba(109, 40, 217, 0.26) 0%, transparent 55%),
        radial-gradient(ellipse 55% 45% at 92% 72%, rgba(168, 85, 247, 0.16) 0%, transparent 50%),
        linear-gradient(180deg, #2a1548 0%, #1a0a2e 22%, #0d0518 50%, #10081f 68%, #1a0a2e 100%);
    }
    
    .main-container {
      display: flex;
      width: 100%;
      min-height: calc(100vh - 80px);
      position: relative;
      z-index: 2;
    }

    @media (max-width: 992px) {
      body {
        padding-top: 60px;
      }

      .main-container {
        min-height: calc(100vh - 60px);
      }
    }
    
    .setup-section {
      flex: 3;
      padding: 40px;
      text-align: center;
      /* شفافية أعلى حتى يظهر تدرج body::before (كان ~0.92 يغطي الخلفية بالكامل) */
      background: linear-gradient(145deg, rgba(45, 26, 74, 0.62), rgba(56, 31, 88, 0.55));
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      box-shadow: 0 0 45px rgba(124, 58, 237, 0.2), 0 12px 40px rgba(0, 0, 0, 0.38);
      border-radius: 0 20px 20px 0;
      border-right: 1px solid var(--border-bright);
    }
    
    .search-container {
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 20px 0 40px;
      gap: 100px;
      flex-wrap: nowrap;
    }

    .search-box-wrap {
      position: relative;
      width: min(62vw, 460px);
      max-width: 460px;
      flex: 0 1 auto;
      order: 1;
    }
    
    .search-box {
      padding: 14px 20px;
      font-size: 1.1em;
      border-radius: 30px;
      border: 2px solid rgba(168, 85, 247, 0.45);
      width: 100%;
      max-width: 100%;
      background-color: rgba(255, 255, 255, 0.94);
      transition: border-color 0.25s ease, box-shadow 0.25s ease;
      color: var(--primary-dark);
      box-shadow: 0 2px 14px rgba(124, 58, 237, 0.12);
      padding-left: 52px;
      padding-right: 20px;
    }
    
    .search-box:focus {
      outline: none;
      border-color: var(--accent-color);
      box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.28), 0 0 24px rgba(124, 58, 237, 0.2);
    }
    
    .search-image {
      width: 200px;
      height: 200px;
      object-fit: cover;
      border: none;
      border-radius: 0;
      flex: 0 0 auto;
      order: 2;
      position: relative;
      z-index: 2;
    }

    .category-filter-btn {
      position: absolute;
      left: -80px;
      top: 50%;
      transform: translateY(-50%);
      width: 36px;
      height: 36px;
      border-radius: 50%;
      border: 1px solid rgba(124, 58, 237, 0.45);
      background: linear-gradient(135deg, #ffffff 0%, #f2e8ff 100%);
      color: var(--primary-dark);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 2px 8px rgba(124, 58, 237, 0.2);
      z-index: 3;
    }

    .category-filter-menu {
      position: absolute;
      left: 0;
      top: calc(100% + 8px);
      min-width: 170px;
      background: rgba(30, 16, 52, 0.96);
      border: 1px solid rgba(168, 85, 247, 0.5);
      border-radius: 12px;
      box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
      padding: 8px;
      display: none;
      z-index: 1200;
    }

    .category-filter-menu.show {
      display: block;
    }

    .category-filter-option {
      width: 100%;
      border: none;
      background: transparent;
      color: #fff;
      text-align: right;
      padding: 8px 10px;
      border-radius: 8px;
      cursor: pointer;
      font-family: inherit;
      font-size: 0.95em;
    }

    .category-filter-option:hover,
    .category-filter-option.active {
      background: rgba(124, 58, 237, 0.35);
    }
    
    .challenges-section {
      flex: 1;
      background: linear-gradient(145deg, rgba(34, 16, 58, 0.58), rgba(45, 26, 74, 0.52));
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      padding: 30px;
      border-left: 1px solid var(--border-bright);
      overflow-y: auto;
      transition: all 0.4s ease;
      position: relative;
      box-shadow: -8px 0 40px rgba(124, 58, 237, 0.22);
    }
    
    .challenges-collapsed {
      flex: 0;
      width: 0;
      padding: 0;
      overflow: hidden;
      border-left: none;
    }
    
    .challenges-collapsed .saved-challenges,
    .challenges-collapsed h2 {
      display: none;
    }
    
    h1 {
      font-size: 3em;
      margin-bottom: 20px;
      color: white;
      text-shadow: 0 0 28px rgba(124, 58, 237, 0.45);
      background: linear-gradient(90deg, var(--orange) 0%, #fbbf24 40%, var(--purple-light) 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      padding: 15px 0;
      letter-spacing: 1px;
    }
    
    h2 {
      color: var(--purple-bright);
      margin-bottom: 30px;
      position: relative;
      padding-bottom: 15px;
      font-size: 1.8em;
      text-shadow: 0 0 20px rgba(124, 58, 237, 0.25);
    }
    
    h2::after {
      content: '';
      position: absolute;
      bottom: 0;
      right: 0;
      width: 120px;
      height: 4px;
      background: linear-gradient(90deg, var(--orange), var(--purple-light));
      border-radius: 4px;
      box-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
    }
    
    .categories {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 20px;
      max-width: 1000px;
      margin: 0 auto 50px;
    }
    
    .category {
      background: linear-gradient(145deg, rgba(45, 26, 74, 0.75), rgba(56, 31, 88, 0.65));
      color: white;
      border: 1px solid var(--border);
      border-radius: 15px;
      cursor: pointer;
      overflow: hidden;
      text-align: center;
      padding: 0;
      position: relative;
      transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
      box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(124, 58, 237, 0.15);
      backdrop-filter: blur(8px);
    }
    
    .category:hover {
      transform: translateY(-8px);
      box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4), 0 0 32px rgba(124, 58, 237, 0.22);
      border-color: var(--border-bright);
    }
    
    .category.selected {
      border: 2px solid var(--accent-color);
      box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.28), 0 0 28px rgba(124, 58, 237, 0.25);
      transform: scale(1.03);
    }
    
    .category img {
      width: 100%;
      height: 140px;
      object-fit: cover;
      filter: brightness(1) saturate(1.1); /* منوّرة دائماً */
      transition: filter 0.4s, transform 0.4s;
    }
    
    .category:hover img {
      filter: brightness(1.08) saturate(1.2);
    }
    
    .category.selected img {
      filter: brightness(1.12) saturate(1.28);
    }
    
    .category-name {
      padding: 12px;
      background: linear-gradient(135deg, rgba(124, 58, 237, 0.55), rgba(76, 29, 149, 0.75));
      color: white;
      font-weight: bold;
      font-size: 1.2em;
      letter-spacing: 0.5px;
    }
    
    .question-count {
      position: absolute;
      top: 10px;
      right: 10px;
      background: linear-gradient(135deg, var(--orange), var(--orange-dark));
      color: white;
      padding: 5px 12px;
      border-radius: 20px;
      font-size: 0.9em;
      backdrop-filter: blur(2px);
      font-weight: bold;
      box-shadow: 0 2px 12px var(--orange-glow);
    }
    
    .selected-categories-sidebar {
      position: fixed;
      right: 20px;
      top: 150px;
      width: 148px;
      background: linear-gradient(145deg, rgba(45, 26, 74, 0.92), rgba(34, 16, 58, 0.88));
      border-radius: 10px;
      padding: 15px;
      box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4), 0 0 20px rgba(124, 58, 237, 0.15);
      border: 1px solid var(--border);
      z-index: 999;
      display: none;
    }

    .selected-categories-sidebar__title {
      color: var(--accent-color);
      text-align: center;
      margin: 0 0 10px;
      font-size: 1em;
      font-weight: 700;
    }
    
    .selected-category-mini {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 10px;
      padding: 5px 6px;
      background: rgba(124, 58, 237, 0.28);
      border-radius: 5px;
      font-size: 0.8em;
      border: 1px solid rgba(168, 85, 247, 0.25);
    }
    
    .selected-category-mini img {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      flex-shrink: 0;
      object-fit: cover;
    }

    .selected-category-mini__label {
      flex: 1;
      min-width: 0;
      font-size: 0.78em;
      line-height: 1.25;
      word-break: break-word;
    }

    .selected-category-mini-remove {
      flex-shrink: 0;
      width: 24px;
      height: 24px;
      padding: 0;
      border: none;
      border-radius: 50%;
      background: rgba(239, 68, 68, 0.4);
      color: #fff;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      line-height: 1;
      transition: background 0.2s ease, transform 0.15s ease;
    }

    .selected-category-mini-remove:hover {
      background: rgba(239, 68, 68, 0.85);
      transform: scale(1.06);
    }

    .selected-category-mini-remove:focus-visible {
      outline: 2px solid var(--accent-light);
      outline-offset: 2px;
    }
    
    .category.disabled {
      opacity: 0.5;
      filter: grayscale(100%);
      cursor: not-allowed;
    }

    .category.category-no-games {
      background: linear-gradient(145deg, rgba(88, 88, 88, 0.78), rgba(62, 62, 62, 0.72));
      border-color: rgba(190, 190, 190, 0.45);
      filter: grayscale(100%);
      cursor: not-allowed;
    }

    .category.category-no-games img {
      filter: grayscale(100%) brightness(0.78) !important;
    }

    .category.category-no-games .category-name {
      background: linear-gradient(135deg, rgba(90, 90, 90, 0.88), rgba(64, 64, 64, 0.9));
      color: #f3f4f6;
    }

    .category.category-no-games .question-count {
      top: 48px;
      background: linear-gradient(135deg, #6b7280, #4b5563);
      box-shadow: 0 2px 10px rgba(75, 85, 99, 0.45);
    }

    .category-ended-banner {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      background: linear-gradient(135deg, #dc2626, #b91c1c);
      color: #ffffff;
      font-size: 0.78em;
      font-weight: 700;
      line-height: 1.35;
      text-align: center;
      padding: 8px 10px;
      z-index: 4;
      box-shadow: 0 2px 10px rgba(127, 29, 29, 0.45);
      pointer-events: none;
    }
    
    .category.disabled:hover {
      transform: none !important;
      box-shadow: none !important;
      border-color: var(--primary-light) !important;
    }
    
    .scroll-down-arrow {
      position: fixed;
      right: 60px;
      bottom: 30px;
      width: 40px;
      height: 40px;
      background: linear-gradient(135deg, var(--orange), var(--orange-dark));
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
      cursor: pointer;
      z-index: 1000;
      opacity: 0;
      transform: translateY(20px);
      transition: all 0.3s ease;
      box-shadow: 0 4px 18px var(--orange-glow);
    }
    
    .scroll-down-arrow.visible {
      opacity: 1;
      transform: translateY(0);
    }
    
    .scroll-down-arrow:hover {
      background: linear-gradient(135deg, #fbbf24, var(--orange));
      transform: translateY(5px) scale(1.1);
      box-shadow: 0 6px 26px var(--orange-glow);
    }
    
    .scroll-down-arrow::after {
      content: '↓';
      color: white;
      font-size: 1.5em;
    }
    
    .football-header {
      grid-column: 1 / -1;
      text-align: center;
      color: var(--accent-color);
      font-size: 1.5em;
      margin: 30px 0 10px;
      padding: 10px;
      background: rgba(124, 58, 237, 0.18);
      border-radius: 10px;
      border: 1px dashed rgba(168, 85, 247, 0.55);
      box-shadow: 0 0 24px rgba(124, 58, 237, 0.15);
    }
    
    .team-count-btn {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--orange), var(--orange-dark));
      color: white;
      border: none;
      font-size: 2em;
      cursor: pointer;
      display: flex;
      justify-content: center;
      align-items: center;
      box-shadow: 0 4px 18px var(--orange-glow);
      transition: all 0.3s ease;
    }
    
    .team-count-btn:hover {
      transform: scale(1.1);
      background: linear-gradient(135deg, #fbbf24, var(--orange)) !important;
      box-shadow: 0 6px 26px var(--orange-glow);
    }
    
    #teamCountDisplay {
      font-size: 3em;
      font-weight: bold;
      color: var(--accent-color);
      min-width: 60px;
      text-align: center;
    }
    
    /* أنماط بطاقات الفرق */
    .team-inputs {
      display: grid;
      gap: 20px;
      margin: 30px auto;
      max-width: 1200px;
      padding: 0 20px;
    }
    
    .team-card {
      background: linear-gradient(145deg, rgba(45, 26, 74, 0.85), rgba(56, 31, 88, 0.75));
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 15px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 15px;
      backdrop-filter: blur(8px);
      transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
      margin: 0;
      width: 100%;
      min-width: 200px;
      box-sizing: border-box;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }
    
    .team-card:hover {
      transform: translateY(-6px);
      box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38), 0 0 28px rgba(124, 58, 237, 0.2);
      border-color: var(--border-bright);
    }
    
    .team-image-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      width: 100%;
    }
    
    .team-image {
      width: 120px;
      height: 120px;
      border-radius: 50%;
      object-fit: cover;
      border: 4px solid var(--accent-color);
      box-shadow: 0 4px 20px var(--orange-glow), 0 0 24px rgba(124, 58, 237, 0.35);
      background: linear-gradient(135deg, #7c3aed, #f59e0b);
    }
    
    .image-nav-buttons {
      display: flex;
      justify-content: center;
      gap: 20px;
      width: 100%;
    }
    
    .image-nav-btn {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: var(--primary-color);
      color: white;
      border: 2px solid white;
      display: flex;
      justify-content: center;
      align-items: center;
      cursor: pointer;
      font-size: 1.5em;
      transition: all 0.3s ease;
      box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    }
    
    .image-nav-btn:hover {
      background: var(--accent-color);
      transform: scale(1.1);
    }
    
    .image-nav-btn:active {
      transform: scale(0.95);
    }
    
    .team-name-input {
      width: 100%;
      padding: 12px;
      font-size: 1.1em;
      border: 2px solid var(--primary-light);
      border-radius: 15px;
      background: rgba(255, 255, 255, 0.9);
      color: var(--primary-dark);
      font-weight: 600;
      text-align: center;
      box-sizing: border-box;
    }
    
    .team-name-input:focus {
      outline: none;
      border-color: var(--accent-color);
      box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.28);
    }
    
    select, input {
      padding: 14px 18px;
      margin: 15px;
      font-size: 1.1em;
      border-radius: 10px;
      border: 2px solid var(--primary-light);
      width: 280px;
      background-color: rgba(255, 255, 255, 0.9);
      transition: all 0.3s;
      color: var(--primary-dark);
    }
    
    select:focus, input:focus {
      outline: none;
      border-color: var(--accent-color);
      box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.28);
    }
    
    .start-btn {
      margin-top: 50px;
      padding: 18px 40px;
      background: linear-gradient(135deg, var(--purple-vivid), #5b21b6);
      color: white;
      border: none;
      border-radius: 18px;
      font-size: 1.4em;
      cursor: pointer;
      transition: all 0.3s ease;
      box-shadow: 0 6px 28px var(--purple-glow);
      position: relative;
      overflow: hidden;
      font-weight: bold;
      letter-spacing: 1px;
    }
    
    .start-btn:hover {
      transform: translateY(-5px);
      box-shadow: 0 12px 40px rgba(124, 58, 237, 0.55), 0 0 36px rgba(168, 85, 247, 0.25);
    }
    
    .start-btn::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: linear-gradient(rgba(255,255,255,0.3), rgba(255,255,255,0));
      opacity: 0;
      transition: opacity 0.4s;
    }
    
    .start-btn:hover::after {
      opacity: 1;
    }
    
    .saved-challenges {
      margin-top: 40px;
    }
    
    .challenge-item {
      background: linear-gradient(145deg, rgba(45, 26, 74, 0.75), rgba(34, 16, 58, 0.7));
      padding: 25px;
      margin-bottom: 25px;
      border-radius: 15px;
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
      cursor: pointer;
      transition: all 0.35s ease;
      border: 1px solid var(--border);
      border-left: 6px solid var(--purple-vivid);
      backdrop-filter: blur(8px);
    }
    
    .challenge-item:hover {
      transform: translateY(-8px);
      box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), 0 0 28px rgba(124, 58, 237, 0.18);
      border-left-color: var(--accent-color);
      background: linear-gradient(145deg, rgba(56, 31, 88, 0.9), rgba(45, 26, 74, 0.85));
    }
    
    .challenge-title {
      font-weight: bold;
      margin-bottom: 10px;
      color: var(--purple-bright);
      font-size: 1.2em;
      text-align: center;
      padding: 8px;
      background: rgba(124, 58, 237, 0.22);
      border-radius: 8px;
      border: 1px solid rgba(168, 85, 247, 0.25);
    }
    
    .challenge-teams {
      font-size: 1em;
      color: #ddd;
      margin-bottom: 10px;
      text-align: center;
      font-weight: bold;
    }
    
    .challenge-date {
      font-size: 0.9em;
      color: var(--primary-light);
      text-align: center;
    }
    
    .challenge-actions {
      display: flex;
      justify-content: space-between;
      margin-top: 20px;
      gap: 15px;
    }
    
    .action-btn {
      padding: 10px 18px;
      border: none;
      border-radius: 10px;
      cursor: pointer;
      font-size: 1em;
      transition: all 0.3s;
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: bold;
    }
    
    .resume-btn {
      background: var(--primary-color);
      color: white;
    }
    
    .resume-btn:hover {
      background: var(--primary-light);
      transform: translateY(-2px);
    }

    .resume-btn.resume-btn-results {
      background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 45%, #d97706 100%);
      color: #1a0a2e;
      box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
    }

    .resume-btn.resume-btn-results:hover {
      background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 50%, #f59e0b 100%);
      color: #1a0a2e;
      transform: translateY(-2px);
      box-shadow: 0 8px 26px rgba(245, 158, 11, 0.55);
    }
    
    .delete-btn {
      background: #d32f2f;
      color: white;
    }
    
    .delete-btn:hover {
      background: #b71c1c;
      transform: translateY(-2px);
    }
    
    .edit-btn {
      background: var(--accent-color);
      color: white;
    }
    
    .edit-btn:hover {
      background: var(--accent-light);
      transform: translateY(-2px);
    }
    
    .show-categories-btn {
      background: rgba(255, 255, 255, 0.15);
      color: var(--secondary-color);
      border: 1px solid rgba(255, 255, 255, 0.3);
      padding: 8px 14px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 0.9em;
      margin: 8px 0;
      width: 100%;
      transition: all 0.3s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }
    
    .show-categories-btn:hover {
      background: rgba(255, 255, 255, 0.25);
      border-color: var(--accent-color);
    }
    
    .challenge-categories-list {
      list-style: none;
      padding: 10px 12px;
      margin: 0 0 10px 0;
      background: rgba(0, 0, 0, 0.2);
      border-radius: 8px;
      font-size: 0.9em;
      color: #ddd;
      display: none;
    }
    
    .challenge-categories-list.visible {
      display: block;
    }
    
    .challenge-categories-list li {
      padding: 4px 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    
    .challenge-categories-list li:last-child {
      border-bottom: none;
    }
    
    .no-challenges {
      color: var(--secondary-color);
      text-align: center;
      margin-top: 40px;
      font-size: 1.2em;
      padding: 25px;
      background: rgba(255,255,255,0.1);
      border-radius: 15px;
      backdrop-filter: blur(5px);
    }
    
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(30px); }
      to { opacity: 1; transform: translateY(0); }
    }
    
    .setup-section {
      animation: fadeIn 0.8s ease-out;
    }
    
    .category {
      animation: fadeIn 0.6s ease-out;
    }
    
    .glow-text {
      text-shadow: 0 0 18px rgba(124, 58, 237, 0.65), 0 0 32px rgba(245, 158, 11, 0.4);
    }
    
    .challenges-collapsed + .toggle-challenges-btn {
      left: 10px;
      background: var(--primary-light);
    }
    
    input::placeholder {
      color: #888;
      font-style: italic;
    }
    
    .challenges-section::-webkit-scrollbar {
      width: 10px;
    }
    
    .challenges-section::-webkit-scrollbar-track {
      background: rgba(26, 10, 46, 0.6);
    }
    
    .challenges-section::-webkit-scrollbar-thumb {
      background: var(--primary-light);
      border-radius: 5px;
    }
    
    .challenges-section::-webkit-scrollbar-thumb:hover {
      background: var(--accent-color);
    }
    
    /* أيقونة معلومات الفئة */
    .category-info-icon {
      position: absolute;
      top: 8px;
      left: 8px;
      width: 28px;              /* أعرض قليلاً */
      height: 24px;
      border-radius: 999px;
      background: linear-gradient(135deg, #ffb74d, #ff9800);
      border: 1px solid rgba(255, 255, 255, 0.9);
      color: #1b1b1b;
      font-size: 0.95em;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      z-index: 2;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
      transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
      font-weight: 800;
      transform-origin: bottom center;   /* ثابت من الأسفل */
      transform: rotate(-18deg);         /* يميل للأعلى من نقطة ثابتة في الأسفل */
    }

    .category-info-icon:hover {
      transform: rotate(-18deg) translateY(-1px) scale(1.08);
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
      background: linear-gradient(135deg, #ffd54f, #ffb300);
    }

    .category-tooltip {
      position: absolute;
      top: 32px;              /* أسفل أيقونة التعجب مباشرة */
      left: 8px;
      right: 8px;
      padding: 6px 8px;
      border-radius: 8px;
      background: rgba(0, 0, 0, 0.85);
      color: #fff;
      font-size: 0.8em;
      line-height: 1.4;
      z-index: 3;
      display: none;
    }

    .category-tooltip.visible {
      display: block;
    }
    
    label {
      color: #ddd;
      font-size: 1.1em;
      display: block;
      margin-bottom: 10px;
    }
    
    select option {
      background: white;
      color: var(--primary-dark);
    }
    
    .error-message {
      color: var(--error-color);
      background-color: rgba(255, 77, 77, 0.1);
      padding: 12px 20px;
      border-radius: 10px;
      margin-top: 20px;
      font-weight: bold;
      text-align: center;
      border: 1px solid var(--error-color);
      display: none;
      animation: shake 0.5s ease-in-out;
    }
    
    @keyframes shake {
      0%, 100% { transform: translateX(0); }
      25% { transform: translateX(-5px); }
      75% { transform: translateX(5px); }
    }

    .progress-info {
      display: flex;
      justify-content: space-between;
      margin-top: 10px;
      font-size: 0.9em;
      color: var(--secondary-color);
    }

    .progress-bar {
      height: 6px;
      background: rgba(255, 255, 255, 0.2);
      border-radius: 3px;
      margin-top: 5px;
      overflow: hidden;
    }

    .progress-fill {
      height: 100%;
      background: var(--accent-color);
      border-radius: 3px;
      transition: width 0.3s ease;
    }

    /* استعلامات الوسائط للشاشات المختلفة */
    @media (min-width: 1200px) {
      .team-inputs {
        grid-template-columns: repeat(4, 1fr);
      }
    }

    @media (min-width: 992px) and (max-width: 1199px) {
      .team-inputs {
        grid-template-columns: repeat(3, 1fr);
      }
    }

    @media (min-width: 768px) and (max-width: 991px) {
      .team-inputs {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    @media (max-width: 767px) {
      .team-inputs {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-auto-flow: row !important;
        gap: 1px;
        padding: 0 1px;
        width: 100% !important;
        box-sizing: border-box;
        margin: 0 !important;
        max-width: 100% !important;
        overflow-x: hidden;
      }

      .team-card {
        padding: 4px !important;
        gap: 2px !important;
        min-width: 0 !important;
        max-width: none !important;
        box-sizing: border-box;
        width: 100% !important;
        overflow: hidden;
        border-radius: 10px !important;
        border-width: 1px !important;
        grid-column: span 1 !important;
        margin: 0 !important;
      }

      .team-image {
        width: 35px;
        height: 35px;
        border-width: 1px;
      }

      .image-nav-btn {
        width: 20px;
        height: 20px;
        font-size: 0.75em;
      }

      .team-name-input {
        font-size: 0.7em;
        padding: 3px;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
      }

      .image-nav-buttons {
        gap: 4px;
      }

      .team-image-container {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
      }

      /* جعل التخطيط عموديًا على الجوال حتى تظهر كل الأقسام */
      .main-container {
        flex-direction: column;
        min-height: auto;
      }

      .setup-section {
        flex: none;
        width: 100%;
        padding: 25px 15px;
        border-radius: 0;
        border-right: none;
        box-shadow: 0 0 28px rgba(124, 58, 237, 0.35);
      }

      .challenges-section {
        flex: none;
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--primary-light);
        box-shadow: 0 -5px 28px rgba(124, 58, 237, 0.25);
      }

      /* إظهار زر التحديات في أعلى القسم وليس على الحافة اليسرى */
      .toggle-challenges-btn {
        display: none !important;
      }
    }

    /* جوال وتاب ضيق: شريط ثابت تحت الهيدر يبقى ظاهرًا أثناء التمرير */
    @media (max-width: 991px) {
      .selected-categories-sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 8px 10px 10px;
        z-index: 900;
        box-sizing: border-box;
        border-radius: 0 0 14px 14px;
        border-top: none;
        max-height: min(240px, 42vh);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
      }

      .selected-categories-sidebar__title {
        margin-bottom: 8px !important;
        font-size: 0.95em;
      }

      #selectedCategoriesList {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        align-items: stretch;
      }

      .selected-category-mini {
        flex: 1 1 calc(50% - 6px);
        min-width: min(140px, 100%);
        max-width: 100%;
        margin-bottom: 0;
        box-sizing: border-box;
      }

      .selected-category-mini img {
        width: 26px;
        height: 26px;
      }

      .selected-category-mini__label {
        font-size: 0.7em;
      }
    }

    /* تحسين أحجام العناصر على الجوال */
    @media (max-width: 600px) {
      .setup-section {
        padding: 15px 2px;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
        overflow-x: hidden;
        overflow-y: visible;
      }

      .main-container {
        width: 100%;
        overflow-x: hidden;
        overflow-y: visible;
      }

      body {
        overflow-x: hidden;
      }

      h1 {
        font-size: 1.8em;
        margin: 10px 0 12px;
      }

      h2 {
        font-size: 1.3em;
        margin-bottom: 16px;
      }

      .search-container {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 12px;
        margin: 8px 0 18px;
        align-items: center;
        width: 100%;
        padding: 0;
        overflow: visible;
      }

      .search-box {
        width: 100%;
        max-width: 100%;
        font-size: 1em;
        padding: 10px 14px;
        padding-left: 48px;
        padding-right: 14px;
        margin: 0;
        box-sizing: border-box;
      }

      .search-box-wrap {
        width: calc(100% - 10px);
        max-width: calc(100vw - 24px);
        flex: 0 1 auto;
        margin: 0 auto;
        box-sizing: border-box;
        z-index: 1200;
        overflow: visible;
      }

      .category-filter-btn {
        width: 34px;
        height: 34px;
        top: 50%;
        transform: translateY(-50%);
        left: 6px;
      }

      .category-filter-menu {
        position: absolute;
        left: 0;
        right: 0;
        min-width: 0;
        width: 100%;
        max-height: none !important;
        height: auto !important;
        overflow: visible;
        -webkit-overflow-scrolling: touch;
        margin-top: 8px;
        box-sizing: border-box;
        z-index: 2000;
      }

      .search-image {
        width: 88px;
        height: 88px;
        margin: 0;
        flex: 0 0 auto;
      }

      .categories {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin: 0 auto 30px;
        padding: 0;
        width: 100%;
      }

      .category img {
        height: 90px;
      }

      .category-name {
        font-size: 0.95em;
        padding: 8px;
      }

      .team-inputs {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-auto-flow: row !important;
        gap: 1px;
        padding: 0 1px;
        width: 100% !important;
        box-sizing: border-box;
        margin: 0 !important;
        max-width: 100% !important;
        overflow-x: hidden;
      }

      .team-card {
        padding: 4px !important;
        gap: 2px !important;
        min-width: 0 !important;
        max-width: none !important;
        box-sizing: border-box;
        width: 100% !important;
        overflow: hidden;
        border-radius: 10px !important;
        border-width: 1px !important;
        grid-column: span 1 !important;
        margin: 0 !important;
      }

      .team-image {
        width: 35px;
        height: 35px;
        border-width: 1px;
      }

      .image-nav-btn {
        width: 20px;
        height: 20px;
        font-size: 0.75em;
      }

      .team-name-input {
        font-size: 0.7em;
        padding: 3px;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
      }

      .image-nav-buttons {
        gap: 4px;
      }

      .team-image-container {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
      }

      select,
      input {
        width: 100%;
        max-width: 100%;
        font-size: 1em;
        margin: 10px 0;
        padding: 10px 12px;
      }

      .start-btn {
        margin-top: 30px;
        padding: 14px 26px;
        font-size: 1.1em;
      }

      .challenges-section {
        display: none !important;
      }

      .mobile-challenges-section {
        display: block !important;
      }
    }

    /* Account details modal — match tahannak without HTML edits */
    #accountDetailsOverlay {
      background: rgba(10, 5, 20, 0.82) !important;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
    }

    #accountDetailsModal > div:nth-child(2) {
      background: linear-gradient(145deg, var(--bg-card), var(--bg-deep)) !important;
      border: 1px solid rgba(168, 85, 247, 0.45) !important;
      box-shadow: 0 0 50px rgba(124, 58, 237, 0.3), 0 20px 50px rgba(0, 0, 0, 0.55) !important;
    }

    /* Floating dots: above main panels so they stay visible; pointer-events:none passes clicks through */
    #particles {
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 3;
    }
