/* ==================== LAYOUT صفحه (دو ستونی) ==================== */
.page-layout {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 280px 1fr;      /* 👈 ستون کارت + ستون محتوا */
    gap: 25px;
    align-items: start;
}

.page-sidebar {
    position: sticky;                        /* 👈 هنگام اسکرول بچسبه بالا */
    top: 100px;
}

.page-main {
    min-width: 0;                            /* 👈 جلوگیری از overflow */
}

/* ==================== PLAYER CARD ==================== */
.player-card {
    width: 100%;
    background: linear-gradient(145deg, #ffffff, #eff6ff);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.12);
    border: 2px solid #bfdbfe;
    direction: rtl;
    transition: all 0.3s ease;
}

.player-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.2);
}

/* دکمه بستن مخفی شد (چون کارت جزئی از صفحه‌ست) */
.player-card-toggle,
.player-card-open {
    display: none !important;
}

/* هدر کارت */
.player-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.player-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    border: 3px solid #3b82f6;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-name {
    color: #1e3a8a;
    font-size: 14px;
    line-height: 1.4;
}

.player-name strong {
    display: block;
    font-size: 17px;
    margin-top: 4px;
    color: #1e3a8a;
}

/* آمار */
.player-stats {
    display: flex;
    gap: 6px;
    margin-top: 15px;
}

.player-stat {
    flex: 1;
    background: #ffffff;
    border-radius: 14px;
    padding: 10px 5px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: 1px solid #e0e7ff;
    transition: 0.3s;
}

.player-stat:hover {
    transform: translateY(-2px);
}

.player-stat .stat-icon {
    font-size: 20px;
}

/* رنگ‌های شاد و محو */
.player-stat:first-child {
    background: linear-gradient(135deg, #fce7f3, #fbcfe8);
    border-color: #f9a8d4;
}

.player-stat:nth-child(2) {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-color: #6ee7b7;
}

.player-stat:nth-child(3) {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #fcd34d;
}

.player-stat small {
    display: block;
    font-size: 10px;
    color: #475569;
}

.player-stat strong {
    display: block;
    font-size: 16px;
}

.player-stat:first-child strong { color: #be185d; }
.player-stat:nth-child(2) strong { color: #047857; }
.player-stat:nth-child(3) strong { color: #b45309; }

/* دکمه پروفایل */
.player-profile-btn {
    display: block;
    margin-top: 18px;
    padding: 11px;
    text-align: center;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-radius: 12px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: 0.25s;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.player-profile-btn:hover {
    transform: scale(1.03);
    color: white;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

/* ==================== RESPONSIVE ==================== */

/* لپ‌تاپ متوسط */
@media (max-width: 1200px) {
    .page-layout {
        grid-template-columns: 240px 1fr;
        gap: 20px;
    }

    .player-card {
        padding: 15px;
    }

    .player-avatar {
        width: 50px;
        height: 50px;
        font-size: 25px;
    }

    .player-name strong {
        font-size: 15px;
    }
}

/* تبلت - کارت بالای محتوا */
@media (max-width: 992px) {
    .page-layout {
        grid-template-columns: 1fr;             /* 👈 یک ستون */
        gap: 15px;
    }

    .page-sidebar {
        position: static;                       /* 👈 غیر sticky */
        top: auto;
    }

    .player-card {
        max-width: 500px;
        margin: 0 auto;
    }

    .player-stats {
        gap: 10px;
    }
}

/* موبایل */
@media (max-width: 768px) {
    .page-layout {
        margin: 15px auto;
        padding: 0 15px;
    }

    .player-card {
        padding: 12px 15px;
        border-radius: 18px;
    }

    .player-header {
        gap: 10px;
        margin-bottom: 12px;
    }

    .player-avatar {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }

    .player-name {
        font-size: 12px;
    }

    .player-name strong {
        font-size: 14px;
    }

    .player-stats {
        gap: 6px;
    }

    .player-stat {
        padding: 8px 4px;
        flex-direction: row;
        justify-content: center;
        gap: 5px;
    }

    .player-stat .stat-icon {
        font-size: 15px;
    }

    .player-stat small {
        display: none;
    }

    .player-stat strong {
        font-size: 13px;
    }

    .player-profile-btn {
        margin-top: 12px;
        padding: 9px;
        font-size: 13px;
    }
}

/* موبایل کوچک */
@media (max-width: 400px) {
    .page-layout {
        padding: 0 10px;
    }

    .player-card {
        padding: 10px 12px;
    }

    .player-avatar {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .player-name strong {
        font-size: 13px;
    }
}

/* ==========================================================================
   دکمه پنل آموزگار (فقط برای معلم‌ها)
   ========================================================================== */

.player-teacher-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.player-teacher-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(139, 92, 246, 0.5);
}

.player-teacher-btn:active {
    transform: translateY(0);
}

.teacher-btn-icon {
    font-size: 1.1rem;
}

/* =========================================
   بنر دعوت‌نامه مدال (چشمک‌زن) - داخل کارت بازیکن
========================================= */
.medal-invite-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 12px;
    padding: 12px;
    margin-top: 15px;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    border: 2px solid #fde68a;
    animation: pulse-glow 2s infinite;
    transition: transform 0.2s;
}

.medal-invite-banner:hover {
    transform: translateY(-3px) scale(1.02);
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 10px rgba(245,158,11,0.4); }
    50% { box-shadow: 0 0 25px rgba(245,158,11,0.8); }
    100% { box-shadow: 0 0 10px rgba(245,158,11,0.4); }
}

.mi-icon {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: wiggle 1s infinite ease-in-out alternate;
}

@keyframes wiggle {
    0% { transform: rotate(-10deg); }
    100% { transform: rotate(10deg); }
}

.mi-text {
    flex: 1;
    margin: 0 10px;
    text-align: right;
}

.mi-text strong {
    font-size: 13px;
    font-weight: 900;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
    display: block;
}

.mi-text span {
    font-size: 11px;
    font-weight: 700;
    color: #fef3c7;
}

.mi-btn {
    background: #ffffff;
    color: #b45309;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 3px 0 #fde68a;
}