/* ============================================
   بطولات تنس الطاولة - Table Tennis Tournaments
   Ihsan Land Portal - Theme: Orange/Red sport vibe
   ============================================ */

/* حاوية الصفحة تترك مسافة قبل الفوتر */
body.dashboard-page > .container:has(.tt-hero),
body.dashboard-page > .container:has(.tt-page-header),
body.dashboard-page > .container:has(.tt-tournament-hero) {
    padding-bottom: 60px;
}

/* دعم الإيموجي للأعلام على كل الأنظمة */
.tt-player-flag,
.tt-flag-emoji,
.tt-match-name,
.tt-winner-name,
.tt-tournament-winner {
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji',
                 'IBM Plex Sans Arabic', 'Tajawal', sans-serif;
}

/* ── الهيرو ── */
.tt-hero {
    text-align: center;
    padding: 48px 20px 32px;
}
.tt-hero-icon {
    font-size: 4rem;
    margin-bottom: 12px;
    animation: ttBounce 2s ease-in-out infinite;
}
@keyframes ttBounce {
    0%, 100% { transform: translateY(0) rotate(-8deg); }
    50%      { transform: translateY(-10px) rotate(8deg); }
}
.tt-hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-text);
    margin: 0 0 12px;
    font-family: 'Tajawal', sans-serif;
}
.tt-hero-gradient {
    background: linear-gradient(135deg, #f59e0b, #ef4444, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.tt-hero-desc {
    color: var(--color-text-light);
    font-size: 1.05rem;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ── شارات الإحصائيات ── */
.tt-stats-row {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.tt-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 14px 22px;
    border-radius: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.tt-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.15);
}
.tt-stat-icon { font-size: 1.8rem; }
.tt-stat-card strong {
    display: block;
    font-size: 1.4rem;
    color: #1f2937;
    font-weight: 800;
}
.tt-stat-card span {
    font-size: 0.82rem;
    color: #6b7280;
}

/* ── شريط الإجراءات ── */
.tt-actions-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}
.tt-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 12px;
    border: none;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.tt-action-primary {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.tt-action-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(245, 158, 11, 0.5);
}
/* زر "بدء بطولة" النابض في صفحة إدارة اللاعبين */
.tt-start-tournament-btn {
    animation: ttReadyPulse 2.2s ease-in-out infinite;
}
@keyframes ttReadyPulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35); }
    50%      { box-shadow: 0 4px 22px rgba(245, 158, 11, 0.7), 0 0 0 6px rgba(245, 158, 11, 0.15); }
}
.tt-start-tournament-btn:hover { animation: none; }
.tt-action-secondary {
    background: #ffffff;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}
.tt-action-secondary:hover {
    background: #f9fafb;
    color: #f59e0b;
    border-color: #f59e0b;
}
.tt-action-disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}
.tt-action-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.tt-action-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.45);
}

/* شارة شعار الفريق في ركن البطاقة (بدون تداخل مع الأفاتار) */
.tt-player-team-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: contain;
    background: white;
    padding: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 2px solid #f3f4f6;
    z-index: 2;
    transition: transform 0.3s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.tt-player-card:hover .tt-player-team-badge {
    animation: playerLogoPulseFast 1.3s ease-in-out infinite;
    border-color: #f59e0b;
}
@keyframes playerLogoPulseFast {
    0%, 100% {
        transform: scale(1.05) rotate(-4deg);
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
    }
    50% {
        transform: scale(1.18) rotate(-12deg);
        box-shadow: 0 8px 20px rgba(245, 158, 11, 0.55);
    }
}
.tt-player-badge-img {
    display: inline-block;
    vertical-align: middle;
    border-radius: 50%;
    object-fit: cover;
    background: white;
    margin-left: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* زر حذف صغير على بطاقة البطولة */
.tt-tournament-card-wrap {
    position: relative;
}
/* wrap يمتد كامل ارتفاع الخلية في الشبكة، والكرت يمتد داخل الـ wrap
   ليجلس زر الحذف داخل حدود الكرت دائماً (حتى لو كان الكرت النشط أقصر) */
.tt-tournament-card-wrap {
    position: relative;
    display: flex;
    height: 100%;
}
.tt-tournament-card-wrap .tt-tournament-card {
    width: 100%;
    display: flex;
    flex-direction: column;
}
.tt-card-delete-btn {
    position: absolute;
    bottom: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    opacity: 0;
    transition: all 0.2s;
}
.tt-tournament-card-wrap:hover .tt-card-delete-btn { opacity: 1; }
.tt-card-delete-btn:hover {
    background: #dc2626;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* زر مسح الشعار */
.tt-clear-btn {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    padding: 4px 0;
    text-align: right;
    align-self: flex-start;
    text-decoration: underline;
}
.tt-clear-btn:hover { color: #991b1b; }
.tt-logo-preview {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-color: #9ca3af;
}

/* تنبيه التعادل + زر المباراة الفاصلة */
.tt-tiebreak-alert {
    margin-top: 12px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1.5px dashed #f59e0b;
    border-radius: 10px;
    padding: 12px 14px;
}
.tt-tiebreak-title {
    font-weight: 800;
    color: #92400e;
    font-size: 0.95rem;
    margin-bottom: 4px;
}
.tt-tiebreak-msg {
    color: #78350f;
    font-size: 0.82rem;
    line-height: 1.6;
    margin-bottom: 10px;
}
.tt-tiebreak-btn {
    width: 100%;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.tt-tiebreak-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* صف متعادل في جدول الترتيب */
.tt-standings-table tr.tied td {
    background: rgba(245, 158, 11, 0.12);
    font-weight: 700;
    color: #92400e;
}

/* ملاحظة تحت جدول الترتيب عندما لا تكون المجموعة مكتملة */
.tt-standings-note {
    margin-top: 10px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.08));
    border: 1px dashed rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    font-size: 0.78rem;
    color: #1e40af;
    text-align: center;
    line-height: 1.6;
}
.tt-standings-note.tt-h2h-note {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(34, 197, 94, 0.08));
    border-color: rgba(16, 185, 129, 0.4);
    color: #047857;
}
.tt-standings-note.tt-h2h-note strong { color: #065f46; }

/* نقاط اللاعب (فوز×3 − خسارة×1) — يطابق الترتيب دائماً */
.tt-points-pill {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
    min-width: 34px;
    text-align: center;
    color: white;
}
.tt-points-pill.positive {
    background: linear-gradient(135deg, #16a34a, #059669);
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.35);
}
.tt-points-pill.zero {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    box-shadow: 0 2px 6px rgba(107, 114, 128, 0.3);
}
.tt-points-pill.negative {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
}

/* صف "قد يتأهل" في نظام 3 مجموعات (أفضل ثانٍ) */
.tt-standings-table tr.maybe-qualified td {
    background: rgba(139, 92, 246, 0.08);
    color: #6d28d9;
    font-weight: 700;
}
.tt-standings-table tr.qualified.maybe-qualified td {
    background: rgba(22, 163, 74, 0.08);
    color: #047857;
}

/* ── حالة فارغة ── */
.tt-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}
.tt-empty-icon { font-size: 4rem; opacity: 0.5; margin-bottom: 12px; }
.tt-empty h3 { color: #1f2937; margin: 0 0 6px; font-size: 1.25rem; }
.tt-empty p { margin: 0; }

/* ── عنوان قسم ── */
.tt-section-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1f2937;
    margin: 32px 0 18px;
    font-family: 'Tajawal', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── شبكة البطولات ── */
.tt-tournaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.tt-tournament-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: block;
}
.tt-tournament-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
}
.tt-tournament-card.completed { border-right: 4px solid #16a34a; }
.tt-tournament-card.active    { border-right: 4px solid #f59e0b; }
.tt-tournament-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}
.tt-tournament-status {
    padding: 4px 12px;
    border-radius: 30px;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}
.tt-tournament-players-badge {
    background: #f3f4f6;
    color: #4b5563;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.78rem;
    font-weight: 700;
}
.tt-tournament-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 6px;
}
.tt-tournament-winner {
    background: linear-gradient(135deg, rgba(22,163,74,0.1), rgba(16,185,129,0.1));
    color: #047857;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.88rem;
    margin: 6px 0;
    display: inline-block;
}
.tt-tournament-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
    flex-wrap: wrap;
}

.tt-readonly-badge {
    background: rgba(59, 130, 246, 0.12);
    color: #1e40af;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
}

/* ── بانر تحفيزي ── */
.tt-motivational {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(239, 68, 68, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 16px;
    padding: 20px 24px;
    margin: 40px 0;
}
.tt-motivational-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.tt-motivational strong { display: block; color: #1f2937; margin-bottom: 4px; }
.tt-motivational p { margin: 0; color: #6b7280; font-size: 0.9rem; }

/* ============================================
   صفحة إدارة اللاعبين
   ============================================ */
.tt-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin: 32px 0 24px;
}
.tt-back-link {
    color: #f59e0b;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 8px;
}
.tt-back-link:hover { text-decoration: underline; }
.tt-page-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1f2937;
    margin: 0 0 6px;
    font-family: 'Tajawal', sans-serif;
}
.tt-page-desc {
    color: #6b7280;
    margin: 0;
    font-size: 0.95rem;
}

.tt-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 60px;
}
.tt-player-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    transition: all 0.2s;
    position: relative;
}
.tt-player-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
    border-color: #f59e0b;
}
.tt-player-card.inactive {
    opacity: 0.55;
    background: #f9fafb;
}
.tt-player-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    /* إطار خفيف حول الصورة (خارج overflow لأنه box-shadow لا يُقص) */
    box-shadow:
        0 0 0 2px white,
        0 0 0 4px rgba(245, 158, 11, 0.25),
        0 3px 10px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}
.tt-player-avatar img {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
/* لمعة تعبر عند اقتراب الماوس */
.tt-player-avatar::after {
    content: '';
    position: absolute;
    top: -20%;
    right: 100%;
    width: 45%;
    height: 140%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
    transform: skewX(-22deg);
    pointer-events: none;
    transition: right 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 3;
}
.tt-player-card:hover .tt-player-avatar::after {
    right: -50%;
}

/* عند اقتراب الماوس: نبض مستمر بطيء + إطار ذهبي متوهّج */
.tt-player-card:hover .tt-player-avatar {
    animation: playerAvatarPulse 2.2s ease-in-out infinite;
}
@keyframes playerAvatarPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 0 0 2px white,
            0 0 0 4px rgba(245, 158, 11, 0.35),
            0 4px 12px rgba(245, 158, 11, 0.15);
    }
    50% {
        transform: scale(1.07);
        box-shadow:
            0 0 0 3px white,
            0 0 0 7px rgba(245, 158, 11, 0.55),
            0 10px 24px rgba(245, 158, 11, 0.4);
    }
}
.tt-player-avatar-placeholder {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 800;
}
.tt-player-flag {
    position: absolute;
    bottom: -4px; left: -4px;
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.tt-player-name {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    font-size: 1rem;
}
.tt-player-stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 14px;
}
.tt-player-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: center;
}

/* Toggle switch */
.tt-toggle {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    cursor: pointer;
}
.tt-toggle input { opacity: 0; width: 0; height: 0; }
.tt-toggle-slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 24px;
    transition: 0.2s;
}
.tt-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    right: 3px; top: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}
.tt-toggle input:checked + .tt-toggle-slider { background: #16a34a; }
.tt-toggle input:checked + .tt-toggle-slider::before { transform: translateX(-18px); }

.tt-icon-btn {
    width: 30px; height: 30px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.tt-icon-btn:hover { background: #f3f4f6; transform: translateY(-1px); }
.tt-icon-btn-danger:hover { background: #fee2e2; border-color: #ef4444; }

/* ============================================
   المودالات (لاعب + مشاركة)
   ============================================ */
.tt-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* SweetAlert2 يجب أن يظهر فوق مودالات TT + استخدام خط تجول */
body .swal2-container { z-index: 20000 !important; }
body .swal2-popup,
body .swal2-title,
body .swal2-html-container,
body .swal2-content,
body .swal2-actions,
body .swal2-confirm,
body .swal2-cancel,
body .swal2-deny,
body .swal2-input,
body .swal2-textarea,
body .swal2-timer-progress-bar-container {
    font-family: 'Tajawal', 'IBM Plex Sans Arabic', sans-serif !important;
}
body .swal2-confirm,
body .swal2-cancel,
body .swal2-deny {
    font-weight: 700 !important;
    padding: 12px 26px !important;
    border-radius: 10px !important;
}
body .swal2-title { font-weight: 800 !important; }
body .swal2-html-container { font-weight: 500 !important; line-height: 1.7 !important; }

/* الأزرار المخصّصة داخل محتوى SweetAlert لا ترث الخط تلقائياً */
body .swal2-popup button,
body .swal2-popup input,
body .swal2-popup select,
body .swal2-popup textarea,
body .swal-winner-btn {
    font-family: 'Tajawal', 'IBM Plex Sans Arabic', sans-serif !important;
}

/* Cropper.js — يجب أن يكون أعلى من مودال اللاعب */
#cropperModal { z-index: 10500; }

.tt-cropper-wrap {
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
    max-height: 55vh;
    margin-bottom: 12px;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tt-cropper-wrap img {
    max-width: 100%;
    display: block;
    max-height: 55vh;
}
/* Cropper.js يحتاج display:block */
.tt-cropper-wrap .cropper-container {
    width: 100% !important;
}
.tt-cropper-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.tt-cropper-controls button {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 8px 14px;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}
.tt-cropper-controls button:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
    transform: translateY(-1px);
}
.tt-modal-overlay.active { display: flex; animation: fadeInOverlay 0.25s ease; }
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }

.tt-modal {
    background: #ffffff;
    border-radius: 20px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    animation: scaleInBox 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    scrollbar-width: thin;
    scrollbar-color: #f59e0b #f9fafb;
}
@keyframes scaleInBox {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
.tt-modal-close {
    position: absolute;
    top: 12px; left: 12px;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
}
.tt-modal-close:hover { background: #fee2e2; color: #dc2626; }
.tt-modal-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1f2937;
    margin: 0 0 20px;
    font-family: 'Tajawal', sans-serif;
}

.tt-form-group { margin-bottom: 16px; }
.tt-form-group label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 6px;
}
.tt-form-group input[type="text"],
.tt-form-group input[type="email"],
.tt-form-group input[type="file"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 0.95rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}
.tt-form-group input:focus { border-color: #f59e0b; }

.tt-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* صف الصورة الشخصية — معاينة مدمجة */
.tt-avatar-row {
    display: flex;
    gap: 14px;
    align-items: center;
}
.tt-avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px dashed #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    transition: all 0.2s;
}
.tt-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;   /* يقصّ تلقائياً بشكل مربّع في الوسط */
    display: block;
}
.tt-avatar-placeholder-icon {
    font-size: 1.6rem;
    opacity: 0.55;
}
.tt-avatar-input-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tt-file-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f9fafb;
    border: 1.5px dashed #d1d5db;
    color: #4b5563;
    padding: 10px 14px;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.tt-file-label:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}
.tt-avatar-input-wrap small {
    color: #6b7280;
    font-size: 0.78rem;
}

/* منتقي العلم — تصميم يعمل على كل الأنظمة (Windows لا يعرض إيموجي الأعلام بألوانها) */
.tt-flag-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    padding: 12px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    scrollbar-width: thin;
    scrollbar-color: #f59e0b #f9fafb;
}
.tt-flag-chip {
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px 6px;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: 'IBM Plex Sans Arabic', 'Tajawal', sans-serif;
}
.tt-flag-chip .tt-flag-emoji {
    font-size: 1.6rem;
    line-height: 1;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}
.tt-flag-chip .tt-flag-label {
    font-size: 0.75rem;
    color: #4b5563;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}
.tt-flag-chip:hover {
    border-color: #f59e0b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}
.tt-flag-chip:hover .tt-flag-label { color: #f59e0b; }
.tt-flag-chip.selected {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}
.tt-flag-chip.selected .tt-flag-label { color: white; }

/* عَلَم مأخوذ من لاعب آخر — معطّل */
.tt-flag-chip.used {
    opacity: 0.35;
    cursor: not-allowed;
    background: repeating-linear-gradient(
        135deg,
        #f3f4f6, #f3f4f6 4px,
        #e5e7eb 4px, #e5e7eb 8px
    );
    position: relative;
}
.tt-flag-chip.used::after {
    content: '🔒';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.7rem;
}
.tt-flag-chip.used:hover {
    transform: none;
    border-color: #e5e7eb;
    box-shadow: none;
}
.tt-flag-chip.used:hover .tt-flag-label { color: #6b7280; }
.tt-flag-selected {
    margin-top: 8px;
    font-size: 0.88rem;
    color: #4b5563;
    text-align: center;
    font-weight: 700;
}

.tt-share-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

/* ============================================
   صفحة البطولة (Match view + Bracket)
   ============================================ */
.tt-tournament-hero {
    background: linear-gradient(135deg, #fef3c7, #fed7aa);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 20px;
    padding: 24px 26px;
    margin-bottom: 28px;
}
.tt-tournament-hero-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1f2937;
    margin: 0 0 6px;
    font-family: 'Tajawal', sans-serif;
}
.tt-tournament-hero-meta {
    color: #92400e;
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* كونفيتي احتفالي عند اكتمال البطولة — يظهر فوق مودال SweetAlert (z: 20000) */
.tt-confetti {
    position: fixed;
    top: -20px;
    width: 12px;
    height: 12px;
    z-index: 25000;
    pointer-events: none;
    animation: ttConfettiFall linear forwards;
    will-change: transform, opacity;
}
/* قصاصات صغيرة للاحتفال بنتيجة مباراة (أصغر من قصاصات الفوز الكبير) */
.tt-mini-confetti {
    width: 8px;
    height: 10px;
    top: 25vh;   /* تبدأ من ثلث الشاشة (قرب الـ modal) */
    z-index: 25100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* بانر "اضغط لتفعيل الصوت" — للتحايل على قيود iOS/Safari */
.tt-sound-banner {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 26000;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 999px;
    border: 2px solid #b45309;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.55), 0 2px 6px rgba(0, 0, 0, 0.15);
    font-family: 'Tajawal', 'IBM Plex Sans Arabic', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
    max-width: 92vw;
    white-space: nowrap;
    animation: ttSoundBannerIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
               ttSoundBannerBounce 2.2s ease-in-out 0.7s infinite;
}
.tt-sound-banner strong { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.tt-sound-banner:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateX(-50%) scale(1.03);
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.65);
}
.tt-sound-banner.is-hiding {
    animation: ttSoundBannerOut 0.3s ease-in forwards;
}
@keyframes ttSoundBannerIn {
    0%   { transform: translateX(-50%) translateY(-40px) scale(0.85); opacity: 0; }
    60%  { transform: translateX(-50%) translateY(4px) scale(1.02); opacity: 1; }
    100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}
@keyframes ttSoundBannerBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(-4px); }
}
@keyframes ttSoundBannerOut {
    to { transform: translateX(-50%) translateY(-30px) scale(0.9); opacity: 0; }
}
@media (max-width: 640px) {
    .tt-sound-banner {
        top: 8px;
        padding: 10px 16px;
        font-size: 0.85rem;
        white-space: normal;
        text-align: center;
        border-radius: 16px;
    }
}

/* Modal الاحتفال بنتيجة المباراة */
.tt-celebrate-popup {
    border-radius: 24px !important;
    box-shadow:
        0 30px 70px rgba(22, 163, 74, 0.35),
        0 0 0 4px rgba(22, 163, 74, 0.08) !important;
    border: 2px solid rgba(22, 163, 74, 0.15) !important;
}
@keyframes ttCelebrateIn {
    0%   { transform: scale(0.3) rotate(-8deg); opacity: 0; }
    55%  { transform: scale(1.08) rotate(3deg); opacity: 1; }
    80%  { transform: scale(0.97) rotate(-1deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
.tt-celebrate-in {
    animation: ttCelebrateIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
@keyframes ttConfettiFall {
    0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* بطاقات تقدّم البطولة */
.tt-progress-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.tt-progress-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}
.tt-progress-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 4px;
    background: currentColor;
}
.tt-progress-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.tt-progress-icon { font-size: 1.8rem; flex-shrink: 0; }
.tt-progress-info { display: flex; flex-direction: column; line-height: 1.3; }
.tt-progress-info strong {
    font-size: 1.5rem;
    font-weight: 900;
    color: #1f2937;
    font-family: 'Tajawal', sans-serif;
    font-variant-numeric: tabular-nums;
}
.tt-progress-info span { font-size: 0.78rem; color: #6b7280; font-weight: 700; }

.tt-progress-card.total { color: #6366f1; }
.tt-progress-card.done { color: #16a34a; background: linear-gradient(135deg, #f0fdf4, #dcfce7); }
.tt-progress-card.done .tt-progress-info strong { color: #15803d; }
.tt-progress-card.remaining { color: #f59e0b; background: linear-gradient(135deg, #fef3c7, #fde68a); }
.tt-progress-card.remaining .tt-progress-info strong { color: #92400e; }
.tt-progress-card.percent { color: #ec4899; }

/* شريط التقدّم */
.tt-progress-bar-wrap {
    background: #f3f4f6;
    height: 18px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
}
.tt-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #ef4444, #ec4899, #16a34a, #ec4899, #ef4444, #f59e0b);
    background-size: 300% 100%;
    animation: ttProgressShimmer 18s ease-in-out infinite;
    border-radius: 12px;
    transition: width 0.6s ease;
    min-width: 4px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}
@keyframes ttProgressShimmer {
    0%   { background-position: 0% 0; }
    50%  { background-position: 100% 0; }
    100% { background-position: 0% 0; }
}

@media (max-width: 720px) {
    .tt-progress-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .tt-progress-card { padding: 10px 12px; }
    .tt-progress-icon { font-size: 1.4rem; }
    .tt-progress-info strong { font-size: 1.15rem; }
}

/* البطل — تصميم 3 أعمدة (شعار | صورة+تاج+اسم | كأس) */
.tt-winner-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fbbf24 100%);
    border: 2px solid #f59e0b;
    border-radius: 24px;
    padding: 28px 24px;
    margin-bottom: 32px;
    position: relative;
    box-shadow: 0 14px 40px rgba(245, 158, 11, 0.35);
    animation: winnerGlow 3s ease-in-out infinite;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;   /* توزيع متساوٍ للأعمدة → مسافات متساوية */
    gap: 20px;
    align-items: center;
    justify-items: center;
}
@keyframes winnerGlow {
    0%, 100% { box-shadow: 0 14px 40px rgba(245, 158, 11, 0.35); }
    50%      { box-shadow: 0 14px 60px rgba(245, 158, 11, 0.65); }
}

/* الجانبان (شعار + كأس) */
.tt-winner-side {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}
.tt-winner-side-logo { justify-content: center; }
.tt-winner-team-logo {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: contain;
    background: white;
    padding: 12px;
    box-shadow: 0 8px 22px rgba(180, 83, 9, 0.25), inset 0 0 0 3px rgba(245,158,11,0.35);
    animation: crownFloat 3s ease-in-out infinite;
}
.tt-winner-side-placeholder {
    width: 130px; height: 130px;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
    display: flex; align-items: center; justify-content: center;
    font-size: 3.5rem;
    opacity: 0.55;
}

/* الوسط: تاج فوق الصورة + الاسم تحت */
.tt-winner-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 260px;
}
.tt-winner-crown-above {
    font-size: 2.6rem;
    animation: crownFloat 2s ease-in-out infinite;
    margin-bottom: -18px;
    z-index: 2;
    filter: drop-shadow(0 4px 6px rgba(180, 83, 9, 0.35));
}
@keyframes crownFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
.tt-winner-avatar-wrap {
    width: 130px;
    height: 130px;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    /* حلقة بيضاء ثم حلقة برتقالية عبر box-shadow (لا تتأثر بـ overflow:hidden لأنها تُرسم خارج الصندوق) */
    box-shadow:
        0 10px 30px rgba(180, 83, 9, 0.45),
        0 0 0 5px white,
        0 0 0 8px #f59e0b;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    transition: transform 0.3s ease;
}

/* لمعة ضوئية متحركة باستمرار على الصورة الشخصية */
.tt-winner-avatar-wrap::before {
    content: '';
    position: absolute;
    top: -20%;
    right: 100%;
    width: 42%;
    height: 140%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.75) 50%,
        transparent 100%);
    transform: skewX(-22deg);
    animation: photoShineLoop 4.5s ease-in-out infinite;
    z-index: 3;
    pointer-events: none;
}
@keyframes photoShineLoop {
    0%   { right: 100%; }
    45%  { right: -60%; }
    100% { right: -60%; }
}

/* عند اقتراب الماوس: نبض + إسراع اللمعة + توهّج ذهبي */
.tt-winner-avatar-wrap:hover {
    animation: photoHoverPulse 1.4s ease-in-out infinite;
    box-shadow:
        0 14px 38px rgba(245, 158, 11, 0.6),
        0 0 0 5px white,
        0 0 0 9px #f59e0b,
        0 0 26px rgba(245, 158, 11, 0.55);
}
.tt-winner-avatar-wrap:hover::before {
    animation-duration: 1.5s;
}
@keyframes photoHoverPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50%      { transform: scale(1.06) rotate(-1deg); }
}

.tt-winner-avatar-photo {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}
.tt-winner-avatar-placeholder {
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 900; font-size: 3.5rem;
    font-family: 'Tajawal', sans-serif;
}
.tt-winner-label {
    color: #78350f;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 3px;
    margin-top: 14px;
    text-transform: uppercase;
}
.tt-winner-champion-name {
    color: #1f2937;
    font-size: 1.75rem;
    font-weight: 900;
    font-family: 'Tajawal', sans-serif;
    margin-top: 4px;
    line-height: 1.2;
}

/* الكأس القابل للنقر — بحجم شعار الفريق (130×130) دائري */
.tt-winner-cup-btn {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff5db, #ffe8a0);
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(180, 83, 9, 0.35), inset 0 0 0 3px rgba(245, 158, 11, 0.45);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tt-winner-cup-emoji {
    display: block;
    font-size: 5.5rem;
    line-height: 1;
    filter: drop-shadow(0 6px 10px rgba(180, 83, 9, 0.4));
    transition: transform 0.3s ease, filter 0.3s ease;
    z-index: 2;
}

/* لمعة تتحرك عرضياً على الكأس عند اقتراب الماوس */
.tt-winner-cup-btn::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0) 20%,
        rgba(255, 255, 255, 0.75) 50%,
        rgba(255, 255, 255, 0) 80%,
        transparent 100%);
    transform: skewX(-20deg);
    transition: right 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1;
    pointer-events: none;
}
.tt-winner-cup-btn:hover {
    animation: cupPulse 1.4s ease-in-out infinite;
    box-shadow: 0 12px 32px rgba(180, 83, 9, 0.55), inset 0 0 0 3px rgba(245, 158, 11, 0.75);
}
.tt-winner-cup-btn:hover::before {
    right: 120%;
}
.tt-winner-cup-btn:hover .tt-winner-cup-emoji {
    filter: drop-shadow(0 10px 16px rgba(180, 83, 9, 0.65)) brightness(1.12);
    transform: scale(1.08);
}
@keyframes cupPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.06); }
}

/* شعار الفريق — يهتز بمرح عند اقتراب الماوس */
.tt-winner-team-logo {
    cursor: default;
    transition: transform 0.3s ease;
}
.tt-winner-team-logo:hover {
    animation: teamLogoWobble 0.9s cubic-bezier(0.36, 0.07, 0.19, 0.97);
    animation-fill-mode: forwards;
}
@keyframes teamLogoWobble {
    0%   { transform: rotate(0deg) scale(1); }
    15%  { transform: rotate(-14deg) scale(1.06); }
    35%  { transform: rotate(12deg) scale(1.08); }
    55%  { transform: rotate(-8deg) scale(1.06); }
    75%  { transform: rotate(5deg) scale(1.04); }
    100% { transform: rotate(0deg) scale(1); }
}

/* اهتزاز الكأس عند النقر */
.tt-cup-shake .tt-winner-cup-emoji {
    animation: ttCupShake 0.7s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes ttCupShake {
    0%   { transform: translateX(0) rotate(0deg); }
    15%  { transform: translateX(-8px) rotate(-6deg); }
    30%  { transform: translateX(8px) rotate(6deg); }
    45%  { transform: translateX(-6px) rotate(-4deg); }
    60%  { transform: translateX(6px) rotate(4deg); }
    75%  { transform: translateX(-3px) rotate(-2deg); }
    100% { transform: translateX(0) rotate(0deg); }
}

/* Responsive */
@media (max-width: 720px) {
    .tt-winner-banner {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 22px 18px;
    }
    .tt-winner-side { min-height: auto; }
    .tt-winner-team-logo, .tt-winner-side-placeholder {
        width: 90px; height: 90px;
    }
    .tt-winner-avatar-wrap { width: 110px; height: 110px; }
    .tt-winner-crown-above { font-size: 2.2rem; margin-bottom: -14px; }
    .tt-winner-champion-name { font-size: 1.4rem; }
    .tt-winner-cup-btn { width: 100px; height: 100px; }
    .tt-winner-cup-emoji { font-size: 4rem; }
}

/* المجموعات — دائماً مجموعتان في كل سطر (2 و 4 مجموعات = 1-2 صفوف، 3 = 2+1) */
.tt-groups-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
@media (max-width: 720px) {
    .tt-groups-row { grid-template-columns: 1fr; }
}
.tt-group-block {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
}
.tt-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px dashed #e5e7eb;
    margin-bottom: 12px;
}
.tt-group-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1f2937;
    margin: 0;
    padding: 0;
    border: none;
    font-family: 'Tajawal', sans-serif;
}
.tt-group-players-count {
    background: #fef3c7;
    color: #92400e;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 0.72rem;
    font-weight: 700;
}

/* شارات لاعبي المجموعة (تحت العنوان) */
.tt-group-players-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    padding: 10px;
    background: linear-gradient(135deg, #fef3c7, #fed7aa);
    border-radius: 10px;
    border: 1px dashed rgba(245, 158, 11, 0.35);
}
.tt-group-player-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
    border-radius: 20px;
    padding: 3px 10px 3px 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.15s;
}
.tt-group-player-chip:hover { transform: translateY(-1px); }
.tt-group-player-chip img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.tt-group-player-initial {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.82rem;
    flex-shrink: 0;
}
.tt-group-player-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
}
.tt-group-player-logo {
    width: 18px !important;
    height: 18px !important;
    padding: 2px;
    background: #f9fafb;
    box-shadow: none !important;
}

.tt-matches-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

/* المباراة */
.tt-match {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto;
    align-items: center;
    gap: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
    transition: all 0.2s;
}
.tt-match > * { min-width: 0; }
.tt-match.done {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #86efac;
}
.tt-match-player {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 4px 8px;
    border-radius: 10px;
    transition: all 0.2s;
}
.tt-match-player.winner {
    background: rgba(22, 163, 74, 0.12);
    color: #047857;
    font-weight: 700;
}
.tt-match-player.loser { opacity: 0.55; }

.tt-match-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    overflow: hidden;
    flex-shrink: 0;
}
.tt-match-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tt-match-name {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tt-trophy-mini { font-size: 0.85rem; margin-right: 3px; }
.tt-match-waiting {
    color: #9ca3af;
    font-size: 0.82rem;
    font-style: italic;
    padding: 6px 0;
}
.tt-match-vs {
    color: #dc2626;
    font-weight: 900;
    font-size: 1.1rem;
    padding: 0 6px;
    flex-shrink: 0;
    min-width: 20px;
    text-align: center;
}
.tt-match-done-icon {
    color: #16a34a;
    font-size: 1.3rem;
    font-weight: 900;
}
.tt-record-btn {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.tt-record-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

/* داخل بطاقات المجموعات: زر أصغر لتوفير مساحة (الأعمدة ضيقة) */
.tt-group-block .tt-record-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
}
.tt-group-block .tt-match {
    gap: 10px;
    padding: 8px 10px;
}
.tt-group-block .tt-match-avatar { width: 32px; height: 32px; font-size: 0.9rem; }
.tt-group-block .tt-match-name { font-size: 0.85rem; }
.tt-group-block .tt-match-vs { padding: 0 4px; font-size: 1rem; }
.tt-match-time {
    color: #047857;
    font-weight: 700;
    font-size: 0.82rem;
    white-space: nowrap;
}
.tt-match-date-mini {
    color: #6b7280;
    font-size: 0.7rem;
    text-align: center;
}
.tt-match-pending {
    color: #9ca3af;
    font-size: 0.85rem;
    padding: 0 8px;
}

/* ترتيب المجموعة */
.tt-standings {
    background: white;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    margin-top: 8px;
}
.tt-standings-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #4b5563;
    margin-bottom: 10px;
}
.tt-standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.tt-standings-table th {
    background: #f9fafb;
    text-align: right;
    padding: 6px 8px;
    font-size: 0.75rem;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}
.tt-standings-table td {
    padding: 8px;
    border-bottom: 1px solid #f3f4f6;
    color: #1f2937;
}
.tt-standings-table tr.qualified td {
    background: rgba(22, 163, 74, 0.08);
    font-weight: 700;
}
.tt-standings-table tr:last-child td { border-bottom: none; }

/* صف Knockout (ربع + نصف) — مباراتان في كل سطر دائماً */
.tt-knockout-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 720px) {
    .tt-knockout-row { grid-template-columns: 1fr; }
}

/* تنبيه تعادل أفضل ثانٍ عبر المجموعات (3-group format) */
.tt-cross-tie-alert {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px dashed #f59e0b;
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 20px;
    animation: ttReadyPulse 2.5s ease-in-out infinite;
}
.tt-cross-tie-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #78350f;
    margin-bottom: 8px;
    font-family: 'Tajawal', sans-serif;
}
.tt-cross-tie-msg {
    color: #7c2d12;
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 14px;
}
.tt-cross-tie-alert .tt-tiebreak-btn {
    width: auto;
    display: inline-block;
    padding: 12px 24px;
}

/* شرح توضيحي فوق الدور القادم */
.tt-knockout-info {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #93c5fd;
    color: #1e40af;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    line-height: 1.7;
    margin-bottom: 14px;
}
.tt-knockout-info strong { color: #1e3a8a; }
.tt-final-wrap {
    max-width: 560px;
    margin: 0 auto 40px;
}
.tt-final-wrap .tt-match {
    background: linear-gradient(135deg, #fef3c7, #fed7aa);
    border-color: #f59e0b;
    padding: 16px 20px;
    gap: 16px;
}
.tt-final-wrap .tt-match .tt-match-name { font-size: 1rem; }
.tt-final-wrap .tt-match-avatar { width: 44px; height: 44px; font-size: 1.1rem; }
.tt-final-wrap .tt-match-vs { padding: 0 10px; font-size: 1.3rem; }

/* ============================================
   صفحة الإحصاءات
   ============================================ */
.tt-stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}
.tt-stat-hero-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 22px 20px;
    text-align: center;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.tt-stat-hero-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 42px rgba(0,0,0,0.12);
}
/* لمعة تعبر البطاقة عند التمرير */
.tt-stat-hero-card::after {
    content: '';
    position: absolute;
    top: -20%;
    right: -60%;
    width: 45%;
    height: 140%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
    transform: skewX(-22deg);
    transition: right 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    z-index: 2;
}
.tt-stat-hero-card:hover::after {
    right: 130%;
}
.tt-stat-hero-card:hover .tt-stat-hero-icon {
    animation: statIconBounce 0.7s ease-out;
}
.tt-stat-hero-card:hover .tt-stat-hero-avatar {
    transform: scale(1.1) rotate(-3deg);
}
.tt-stat-hero-card:hover .tt-stat-hero-logo {
    animation: statLogoWobble 0.9s ease;
}
@keyframes statIconBounce {
    0%   { transform: scale(1) rotate(0); }
    30%  { transform: scale(1.25) rotate(-8deg); }
    60%  { transform: scale(1.1) rotate(6deg); }
    100% { transform: scale(1) rotate(0); }
}
@keyframes statLogoWobble {
    0%   { transform: rotate(0) scale(1); }
    25%  { transform: rotate(-18deg) scale(1.15); }
    75%  { transform: rotate(15deg) scale(1.15); }
    100% { transform: rotate(0) scale(1); }
}
.tt-stat-hero-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: currentColor;
    opacity: 0.6;
}
.tt-stat-hero-icon {
    font-size: 2.6rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.12));
}
.tt-stat-hero-label-top {
    font-size: 0.78rem;
    font-weight: 800;
    color: #6b7280;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.tt-stat-hero-value {
    font-size: 2.6rem;
    font-weight: 900;
    color: #1f2937;
    line-height: 1;
    margin: 6px 0;
    font-family: 'Tajawal', sans-serif;
}
.tt-stat-hero-label {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 700;
}
.tt-stat-hero-player {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 10px 0 6px;
    min-height: 64px;
    align-items: center;
}
.tt-stat-hero-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tt-stat-hero-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: contain;
    background: white;
    padding: 4px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    align-self: flex-end;
    margin-right: -10px;
    border: 2px solid rgba(255,255,255,0.9);
    transition: transform 0.3s ease;
}

/* بطاقة الإجمالي — أرقام مركّبة (X من Y) */
.tt-stat-total-numbers {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin: 6px 0 4px;
    font-family: 'Tajawal', sans-serif;
    font-variant-numeric: tabular-nums;
}
.tt-stat-total-big {
    font-size: 2.4rem;
    font-weight: 900;
    color: #f59e0b;
    line-height: 1;
}
.tt-stat-total-sep {
    font-size: 1.4rem;
    color: #9ca3af;
    font-weight: 400;
}
.tt-stat-total-small {
    font-size: 1.4rem;
    color: #6b7280;
    font-weight: 700;
}
.tt-stat-hero-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1f2937;
    margin: 6px 0;
    font-family: 'Tajawal', sans-serif;
}
.tt-stat-hero-metric {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    background: rgba(0,0,0,0.05);
    color: #1f2937;
}

/* ألوان البطاقات */
.tt-stat-total { color: #f59e0b; }
.tt-stat-total .tt-stat-hero-value { color: #f59e0b; }

.tt-stat-champion { color: #f59e0b; background: linear-gradient(135deg, #fef3c7, #fde68a); }
.tt-stat-champion .tt-stat-hero-metric { background: rgba(245, 158, 11, 0.2); color: #92400e; }

.tt-stat-active { color: #6366f1; background: linear-gradient(135deg, #ede9fe, #ddd6fe); }
.tt-stat-active .tt-stat-hero-metric { background: rgba(99, 102, 241, 0.2); color: #4338ca; }

/* بطاقة الأكثر خسارة — خلفية حمراء */
.tt-stat-loser {
    color: #dc2626;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-color: #f87171;
}
.tt-stat-loser .tt-stat-hero-name { color: #7f1d1d; }
.tt-stat-loser .tt-stat-hero-label-top { color: #b91c1c; }
.tt-stat-loser .tt-stat-hero-metric { background: rgba(220, 38, 38, 0.2); color: #7f1d1d; }

.tt-stat-empty { background: #f9fafb; }

/* جدول الإحصاءات */
.tt-stats-table-wrap {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 60px;
}
.tt-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.tt-stats-table thead th {
    background: #f9fafb;
    padding: 12px;
    text-align: right;
    font-size: 0.82rem;
    color: #4b5563;
    font-weight: 700;
    border-bottom: 2px solid #e5e7eb;
}
.tt-stats-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #1f2937;
}
.tt-stats-table tbody tr:hover td { background: #fef3c7; }
.tt-stats-table tbody tr:last-child td { border-bottom: none; }

.tt-stats-player-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}
.tt-stats-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.tt-stats-avatar-placeholder {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.tt-stat-pill {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 0.85rem;
}
.tt-stat-pill.won { background: rgba(22, 163, 74, 0.15); color: #047857; }
.tt-stat-pill.lost { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }

.tt-winrate-bar {
    position: relative;
    background: #f3f4f6;
    border-radius: 10px;
    height: 22px;
    min-width: 110px;
    overflow: hidden;
}
.tt-winrate-fill {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    border-radius: 10px;
    transition: width 0.4s;
}
.tt-winrate-bar span {
    position: relative;
    display: block;
    text-align: center;
    line-height: 22px;
    font-weight: 800;
    font-size: 0.78rem;
    color: #1f2937;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
    z-index: 1;
}

/* استجابية */
@media (max-width: 640px) {
    .tt-hero-title { font-size: 1.6rem; }
    .tt-hero-icon { font-size: 3rem; }
    .tt-stat-card { padding: 10px 14px; }
    .tt-stat-icon { font-size: 1.4rem; }
    .tt-stat-card strong { font-size: 1.15rem; }
    .tt-actions-bar { flex-direction: column; }
    .tt-action-btn { width: 100%; justify-content: center; }
    .tt-players-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .tt-player-avatar { width: 64px; height: 64px; }
    .tt-match {
        grid-template-columns: 1fr auto 1fr;
        grid-template-rows: auto auto;
    }
    .tt-match-action { grid-column: 1 / -1; text-align: center; }
    .tt-record-btn { width: 100%; }
    .tt-winner-name { font-size: 1.5rem; }
    .tt-winner-cup { font-size: 3.5rem; }

    /* stats على الجوال */
    .tt-stats-cards { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
    .tt-stat-hero-card { padding: 16px 14px; }
    .tt-stat-hero-icon { font-size: 2rem; }
    .tt-stat-hero-value { font-size: 2rem; }
    .tt-stat-hero-avatar { width: 44px; height: 44px; }
    .tt-stat-hero-name { font-size: 1rem; }
    .tt-stats-table { font-size: 0.82rem; }
    .tt-stats-table thead th, .tt-stats-table tbody td { padding: 8px 6px; }
    .tt-stats-avatar, .tt-stats-avatar-placeholder { width: 28px; height: 28px; }
    .tt-winrate-bar { min-width: 80px; }
}

/* ═════════════════════════════════════════════════════════════
   زر قفل البطولة + شارة القفل
   ═════════════════════════════════════════════════════════════ */
.tt-lock-btn {
    padding: 8px 14px;
    border: 1.5px solid;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    line-height: 1;
    white-space: nowrap;
}
.tt-lock-btn .tt-lock-icon {
    font-size: 1.1rem;
    line-height: 1;
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tt-lock-btn:hover .tt-lock-icon { transform: scale(1.2) rotate(-8deg); }

/* حالة "غير مقفلة" — يدعو للقفل (لون أخضر مطمئن) */
.tt-lock-btn.is-unlocked {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
    border-color: #10b981;
}
.tt-lock-btn.is-unlocked:hover {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border-color: #059669;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

/* حالة "مقفلة" — لون رمادي/عنبري يشير للحماية */
.tt-lock-btn.is-locked {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #78350f;
    border-color: #f59e0b;
    box-shadow: 0 3px 8px rgba(245, 158, 11, 0.25);
}
.tt-lock-btn.is-locked:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border-color: #d97706;
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

/* زر النشر للعامة (بجانب زر القفل) */
.tt-publish-btn {
    padding: 8px 14px;
    border: 1.5px solid;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    line-height: 1;
    white-space: nowrap;
}
.tt-publish-btn .tt-publish-icon {
    font-size: 1.1rem;
    display: inline-block;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tt-publish-btn:hover .tt-publish-icon { transform: scale(1.25) rotate(15deg); }

/* حالة "خاصة" — يدعو للنشر (لون أزرق ودّي) */
.tt-publish-btn.is-private {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #075985;
    border-color: #0ea5e9;
}
.tt-publish-btn.is-private:hover {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
    transform: translateY(-1px);
}

/* حالة "منشورة" — تُشير إلى الحماية بالإخفاء */
.tt-publish-btn.is-public {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    color: #5b21b6;
    border-color: #8b5cf6;
    box-shadow: 0 3px 8px rgba(139, 92, 246, 0.22);
}
.tt-publish-btn.is-public:hover {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #ffffff;
    border-color: #7c3aed;
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

/* شارة "منشورة للعامة" داخل hero البطولة */
.tt-public-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    color: #5b21b6;
    border: 1.5px solid #8b5cf6;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.2);
    animation: publicPulseGlow 3s ease-in-out infinite;
}
@keyframes publicPulseGlow {
    0%, 100% { box-shadow: 0 2px 6px rgba(139, 92, 246, 0.2); }
    50%      { box-shadow: 0 4px 14px rgba(139, 92, 246, 0.5); }
}

/* شارة "مقفلة" داخل hero البطولة (بجانب حالة البطولة) */
.tt-locked-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #78350f;
    border: 1.5px solid #f59e0b;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2);
    animation: lockPulseGlow 3s ease-in-out infinite;
}
@keyframes lockPulseGlow {
    0%, 100% { box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2); }
    50%      { box-shadow: 0 4px 14px rgba(245, 158, 11, 0.5); }
}

/* ═════════════════════════════════════════════════════════════
   زر تعديل/تراجع عن نتيجة المباراة
   ═════════════════════════════════════════════════════════════ */
.tt-match-undo-btn {
    margin-top: 6px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #78350f;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
    white-space: nowrap;
}
.tt-match-undo-btn:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
}
.tt-match-undo-btn:active {
    transform: translateY(0);
}

/* ═════════════════════════════════════════════════════════════
   شريط الإجراءات الجماعية (اختيار/حذف البطولات)
   ═════════════════════════════════════════════════════════════ */
.tt-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #ffffff, #f9fafb);
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px 16px;
    margin: 12px 0 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}
.tt-bulk-bar.has-selection {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.18);
}
.tt-bulk-controls,
.tt-bulk-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.tt-bulk-status { min-width: 0; }
.tt-bulk-status #ttSelectionCount {
    color: #4b5563;
    font-size: 0.9rem;
    padding: 0 6px;
}
.tt-bulk-btn {
    padding: 8px 14px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    white-space: nowrap;
}
.tt-bulk-select {
    background: #ffffff;
    color: #374151;
    border-color: #d1d5db;
}
.tt-bulk-select:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-1px);
}
.tt-bulk-clear {
    background: #ffffff;
    color: #6b7280;
    border-color: #e5e7eb;
}
.tt-bulk-clear:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fca5a5;
}
.tt-bulk-delete {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
    border-color: #b91c1c;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}
.tt-bulk-delete:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    border-color: #e5e7eb;
    box-shadow: none;
    cursor: not-allowed;
}
.tt-bulk-delete:not(:disabled):hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(220, 38, 38, 0.4);
}

/* Checkbox على كل بطاقة بطولة — تطفو خارج الزاوية العلوية اليسرى (RTL) لتجنّب تداخل شارة "N لاعبين" */
.tt-card-select {
    position: absolute;
    top: -11px;
    left: -11px;  /* يسار في RTL = خارج زاوية البطاقة، بعيد عن زر الحذف الذي في اليمين */
    z-index: 5;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}
.tt-card-checkbox {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
    inset: 0;
}
.tt-card-checkbox-visual {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #ffffff;
    border: 2px solid #d1d5db;
    border-radius: 9px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transition: all 0.2s ease;
    position: relative;
}
.tt-card-checkbox-visual::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    width: 9px;
    height: 15px;
    border-right: 3px solid #ffffff;
    border-bottom: 3px solid #ffffff;
    transform: rotate(45deg) scale(0);
    transition: transform 0.15s ease;
}
.tt-card-checkbox:hover + .tt-card-checkbox-visual {
    border-color: #f59e0b;
    background: #fffbeb;
    transform: scale(1.12);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3);
}
.tt-card-checkbox:checked + .tt-card-checkbox-visual {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #b45309;
    box-shadow: 0 5px 14px rgba(245, 158, 11, 0.5);
}
.tt-card-checkbox:checked + .tt-card-checkbox-visual::after {
    transform: rotate(45deg) scale(1);
}

/* بطاقة مختارة — إطار ذهبي واضح */
.tt-tournament-card-wrap.selected .tt-tournament-card {
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.28);
    transform: translateY(-3px);
}

/* داخل بطاقات المالك — meta يترك مساحة للزر الدائري في الزاوية السفلى اليسرى */
.tt-tournament-card-wrap .tt-tournament-card .tt-tournament-meta {
    padding-left: 46px; /* حجم زر الحذف (32px) + المسافة (12px) + هامش (2px) */
}
/* البطاقات المقفلة لا تحوي زر حذف → لا حاجة للمسافة */
.tt-tournament-card-wrap.is-locked .tt-tournament-card .tt-tournament-meta {
    padding-left: 0;
}

/* بطاقة مقفلة — إطار عنبري ورمز قفل بدل checkbox */
.tt-tournament-card-wrap.is-locked .tt-tournament-card {
    border: 1.5px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}
.tt-card-lock-indicator {
    position: absolute;
    top: -11px;
    left: -11px;
    z-index: 5;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border: 2px solid #b45309;
    border-radius: 9px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.5);
    font-size: 1rem;
    cursor: help;
    animation: lockCardPulse 2.6s ease-in-out infinite;
}
@keyframes lockCardPulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45); }
    50%      { box-shadow: 0 6px 20px rgba(245, 158, 11, 0.7); transform: scale(1.05); }
}

/* شارات صغيرة داخل meta البطاقة */
.tt-card-locked-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #78350f;
    border: 1px solid #f59e0b;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}
.tt-card-public-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    color: #5b21b6;
    border: 1px solid #8b5cf6;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}

/* زر معطّل (محميّة من الحذف) */
.tt-action-disabled {
    background: #e5e7eb !important;
    color: #6b7280 !important;
    border: 1.5px solid #d1d5db !important;
    cursor: not-allowed !important;
    opacity: 0.75;
    box-shadow: none !important;
}
.tt-action-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
    background: #e5e7eb !important;
}

@media (max-width: 640px) {
    .tt-bulk-bar { flex-direction: column; align-items: stretch; }
    .tt-bulk-controls, .tt-bulk-status { justify-content: center; }
    .tt-bulk-btn { flex: 1; justify-content: center; min-width: 0; }
    .tt-card-select { top: -9px; left: -9px; width: 26px; height: 26px; }
    .tt-card-checkbox-visual { width: 26px; height: 26px; border-radius: 8px; }
    .tt-card-checkbox-visual::after { left: 7px; top: 3px; width: 8px; height: 13px; }
}

/* ═════════════════════════════════════════════════════════════
   بانر دعوة للانضمام — يظهر للزوار غير المسجّلين
   ═════════════════════════════════════════════════════════════ */
.tt-public-cta {
    display: flex;
    align-items: center;
    gap: 24px;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 50%, #eff6ff 100%);
    border: 2px solid #10b981;
    border-radius: 24px;
    padding: 28px 32px;
    margin: 40px 0 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.18);
}
.tt-public-cta::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -20%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.tt-public-cta::after {
    content: '';
    position: absolute;
    bottom: -60%;
    left: -20%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.tt-public-cta-icon {
    font-size: 4.5rem;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.15));
    animation: ctaBounce 3s ease-in-out infinite;
    z-index: 1;
}
@keyframes ctaBounce {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50%      { transform: translateY(-8px) rotate(4deg); }
}
.tt-public-cta-body {
    flex: 1;
    min-width: 0;
    z-index: 1;
    position: relative;
}
.tt-public-cta-title {
    font-family: 'Tajawal', 'IBM Plex Sans Arabic', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: #065f46;
    margin: 0 0 10px;
    line-height: 1.5;
}
.tt-public-cta-text {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.9;
    margin: 0 0 18px;
}
.tt-public-cta-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.tt-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Tajawal', 'IBM Plex Sans Arabic', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
    line-height: 1;
    border: 2px solid transparent;
}
.tt-cta-btn-primary {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.35);
}
.tt-cta-btn-primary:hover {
    background: linear-gradient(135deg, #15803d, #166534);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.5);
    color: #ffffff;
}
.tt-cta-btn-secondary {
    background: #ffffff;
    color: #065f46;
    border-color: #10b981;
}
.tt-cta-btn-secondary:hover {
    background: #ecfdf5;
    border-color: #059669;
    transform: translateY(-2px);
    color: #065f46;
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.25);
}

@media (max-width: 640px) {
    .tt-public-cta { flex-direction: column; text-align: center; padding: 24px 20px; gap: 16px; }
    .tt-public-cta-icon { font-size: 3.5rem; }
    .tt-public-cta-title { font-size: 1.15rem; }
    .tt-public-cta-actions { justify-content: center; }
    .tt-cta-btn { flex: 1; min-width: 140px; padding: 12px 16px; font-size: 0.92rem; }
}
