/**
 * KermanFoosball — Public styles
 * پالت: آبی نفتی + نارنجی
 * فونت: Vazirmatn
 */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
    --kf-primary: #0f3460;
    --kf-primary-dark: #0a2547;
    --kf-primary-light: #1a4a7a;
    --kf-accent: #e94560;
    --kf-accent-dark: #d13650;
    --kf-bg: #f8f9fb;
    --kf-card: #ffffff;
    --kf-text: #1a1a2e;
    --kf-text-muted: #64748b;
    --kf-border: #e5e7eb;
    --kf-success: #16a34a;
    --kf-success-bg: #dcfce7;
    --kf-gray: #64748b;
    --kf-gray-bg: #f1f5f9;
    --kf-radius: 14px;
    --kf-radius-sm: 10px;
    --kf-radius-pill: 999px;
    --kf-shadow: 0 4px 16px rgba(15, 52, 96, .07);
    --kf-shadow-hover: 0 12px 32px rgba(15, 52, 96, .13);
    --kf-font: 'Vazirmatn', 'Vazir', Tahoma, Arial, sans-serif;
}

/* ==============================
   پایه
   ============================== */

.kf-public-wrap {
    direction: rtl;
    max-width: 1100px;
    margin: 32px auto;
    padding: 0 20px;
    color: var(--kf-text);
    font-family: var(--kf-font);
    font-size: 15px;
    line-height: 1.9;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.kf-public-wrap *,
.kf-public-wrap *::before,
.kf-public-wrap *::after {
    box-sizing: border-box;
    font-family: inherit;
}

.kf-public-wrap img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==============================
   هدر
   ============================== */

.kf-hero {
    padding: 32px 28px;
    margin-bottom: 28px;
    background: linear-gradient(135deg, var(--kf-primary), var(--kf-primary-light));
    border-radius: var(--kf-radius);
    color: #fff;
    box-shadow: var(--kf-shadow);
}

.kf-hero-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 8px;
    color: #fff;
    font-size: clamp(20px, 3.5vw, 30px);
    font-weight: 800;
    line-height: 1.6;
}

.kf-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, .14);
    border-radius: var(--kf-radius-sm);
    font-size: 26px;
}

.kf-hero-desc {
    margin: 0;
    color: rgba(255, 255, 255, .82);
    font-size: 14px;
    line-height: 1.9;
}

/* ==============================
   لیست مسابقات
   ============================== */

.kf-events-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kf-event-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--kf-card);
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius);
    box-shadow: var(--kf-shadow);
    text-decoration: none;
    color: inherit;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.kf-event-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--kf-shadow-hover);
    border-color: var(--kf-primary-light);
}

.kf-event-thumb {
    flex: 0 0 140px;
    width: 140px;
    height: 140px;
    overflow: hidden;
    border-radius: var(--kf-radius-sm);
    background: var(--kf-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kf-event-thumb img,
.kf-event-thumb .kf-avatar-default {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--kf-radius-sm);
}

.kf-event-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kf-event-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.kf-event-title {
    margin: 0;
    color: var(--kf-primary);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.7;
    word-break: break-word;
}

.kf-status {
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--kf-radius-pill);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    line-height: 1.8;
}

.kf-status-open {
    background: var(--kf-success-bg);
    color: var(--kf-success);
}

.kf-status-completed {
    background: var(--kf-gray-bg);
    color: var(--kf-gray);
}

.kf-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 8px;
    color: var(--kf-text-muted);
    font-size: 13px;
}

.kf-event-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.kf-event-desc {
    margin: 0;
    color: var(--kf-text-muted);
    font-size: 13px;
    line-height: 1.9;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

/* ==============================
   تک مسابقه
   ============================== */

.kf-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    color: var(--kf-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: color .15s;
}

.kf-back-link:hover {
    color: var(--kf-accent);
}

.kf-single-hero {
    display: flex;
    gap: 24px;
    padding: 28px;
    margin-bottom: 28px;
    background: var(--kf-card);
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius);
    box-shadow: var(--kf-shadow);
    align-items: flex-start;
}

.kf-single-thumb {
    flex: 0 0 220px;
    width: 220px;
    height: 220px;
    overflow: hidden;
    border-radius: var(--kf-radius-sm);
    background: var(--kf-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kf-single-thumb img,
.kf-single-thumb .kf-avatar-default {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--kf-radius-sm);
}

.kf-single-body {
    flex: 1 1 auto;
    min-width: 0;
}

.kf-single-title {
    margin: 0 0 12px;
    color: var(--kf-primary);
    font-size: clamp(19px, 3vw, 26px);
    font-weight: 800;
    line-height: 1.6;
    word-break: break-word;
}

.kf-single-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    margin-bottom: 12px;
    color: var(--kf-text-muted);
    font-size: 14px;
}

.kf-single-desc {
    margin: 14px 0 0;
    color: var(--kf-text);
    font-size: 14px;
    line-height: 2;
    word-break: break-word;
}

/* ==============================
   بخش‌ها
   ============================== */

.kf-section {
    margin-bottom: 28px;
}

.kf-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.kf-section-bar {
    display: block;
    flex: 0 0 4px;
    width: 4px;
    height: 24px;
    border-radius: var(--kf-radius-pill);
    background: var(--kf-accent);
}

.kf-section-title {
    margin: 0;
    color: var(--kf-primary);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.6;
}

.kf-section-count {
    margin-right: auto;
    padding: 3px 12px;
    background: var(--kf-bg);
    color: var(--kf-text-muted);
    border-radius: var(--kf-radius-pill);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.8;
}

/* ==============================
   جدول
   ============================== */

.kf-table-wrap {
    overflow-x: auto;
    background: var(--kf-card);
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius);
    box-shadow: var(--kf-shadow);
    -webkit-overflow-scrolling: touch;
}

.kf-table {
    width: 100%;
    min-width: 520px;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.kf-table thead th {
    padding: 13px 12px;
    background: var(--kf-primary);
    color: #fff;
    text-align: center;
    white-space: nowrap;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.8;
}

.kf-table thead th:first-child {
    border-top-right-radius: var(--kf-radius);
}

.kf-table thead th:last-child {
    border-top-left-radius: var(--kf-radius);
}

.kf-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--kf-border);
    text-align: center;
    vertical-align: middle;
    line-height: 1.9;
    word-break: break-word;
}

.kf-table tbody tr:last-child td {
    border-bottom: 0;
}

.kf-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.kf-table tbody tr:hover {
    background: #f0f4f9;
}

/* ردیف‌های برتر */
.kf-place-1 { background: #fff8e6 !important; }
.kf-place-2 { background: #f1f5f9 !important; }
.kf-place-3 { background: #fff3e8 !important; }

.kf-place-1:hover { background: #ffefc2 !important; }
.kf-place-2:hover { background: #e5ecf3 !important; }
.kf-place-3:hover { background: #ffe4d1 !important; }

/* ==============================
   لینک و امتیاز
   ============================== */

.kf-player-link {
    color: var(--kf-primary);
    text-decoration: none;
    font-weight: 700;
    transition: color .15s;
    word-break: break-word;
}

.kf-player-link:hover {
    color: var(--kf-accent);
    text-decoration: underline;
}

.kf-points {
    color: var(--kf-accent);
    font-weight: 800;
}

.kf-medal {
    margin-left: 4px;
    font-size: 16px;
}

/* ==============================
   برچسب‌ها
   ============================== */

.kf-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--kf-radius-pill);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.9;
}

.kf-tag-yes {
    background: var(--kf-success-bg);
    color: var(--kf-success);
}

.kf-tag-no {
    background: var(--kf-gray-bg);
    color: var(--kf-gray);
}

.kf-tag-group {
    background: #e8eef5;
    color: var(--kf-primary);
}

/* ==============================
   حالت خالی
   ============================== */

.kf-empty {
    padding: 32px 20px;
    color: var(--kf-text-muted);
    text-align: center;
    background: var(--kf-bg);
    border: 1px dashed #cbd5e1;
    border-radius: var(--kf-radius);
    font-size: 14px;
    line-height: 2;
}

.kf-empty a {
    color: var(--kf-primary);
    font-weight: 700;
}

/* ==============================
   ستون دوگانه
   ============================== */

.kf-two-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

/* ==============================
   آواتار پیش‌فرض
   ============================== */

.kf-avatar-default {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef3ee;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    vertical-align: middle;
    width: 50px;
    height: 50px;
}

.kf-avatar-default::before {
    content: "";
    display: block;
    width: 40%;
    height: 40%;
    border-radius: 50%;
    background: var(--kf-primary);
    position: absolute;
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
}

.kf-avatar-default::after {
    content: "";
    display: block;
    width: 70%;
    height: 38%;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    background: var(--kf-primary);
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.kf-avatar-default.kf-avatar-event {
    background: var(--kf-primary);
    border-radius: var(--kf-radius-sm);
    width: 100%;
    height: 100%;
}

.kf-avatar-default.kf-avatar-event::before {
    width: 30%;
    height: 30%;
    border-radius: 4px;
    background: var(--kf-accent);
    top: 22%;
}

.kf-avatar-default.kf-avatar-event::after {
    width: 50%;
    height: 12%;
    border-radius: 3px;
    background: var(--kf-accent);
    bottom: 22%;
}

/* ==============================
   پروفایل بازیکن
   ============================== */

.kf-profile-hero {
    display: flex;
    gap: 24px;
    align-items: center;
    padding: 28px;
    margin-bottom: 28px;
    background: linear-gradient(135deg, var(--kf-primary), var(--kf-primary-light));
    border-radius: var(--kf-radius);
    color: #fff;
    box-shadow: var(--kf-shadow);
}

.kf-profile-avatar {
    flex: 0 0 140px;
    width: 140px;
    height: 140px;
    overflow: hidden;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, .2);
    background: #fff;
}

.kf-profile-avatar img,
.kf-profile-avatar .kf-avatar-default {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.kf-profile-info {
    flex: 1 1 auto;
    min-width: 0;
}

.kf-profile-name {
    margin: 0 0 10px;
    color: #fff;
    font-size: clamp(22px, 3.5vw, 30px);
    font-weight: 800;
    line-height: 1.5;
    word-break: break-word;
}

.kf-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, .9);
    font-size: 14px;
}

.kf-profile-meta strong {
    color: #ffd884;
    font-size: 18px;
}

.kf-profile-meta .kf-tag-group {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.kf-profile-bio {
    margin: 0;
    color: rgba(255, 255, 255, .88);
    font-size: 14px;
    line-height: 2;
    word-break: break-word;
}

/* فرم انتخاب سال */
.kf-year-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.kf-year-form label {
    color: var(--kf-text-muted);
    font-size: 13px;
    font-weight: 700;
}

.kf-year-form select {
    min-width: 120px;
    min-height: 40px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius-sm);
    color: var(--kf-text);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}

.kf-year-form select:focus {
    outline: 2px solid var(--kf-accent);
    outline-offset: 1px;
    border-color: var(--kf-accent);
}

/* خلاصه رتبه‌بندی */
.kf-ranking-summary {
    display: grid;
    grid-template-columns: minmax(130px, 0.7fr) 2fr;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius);
    box-shadow: var(--kf-shadow);
}

.kf-ranking-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 22px 14px;
    background: var(--kf-primary);
    color: #fff;
    text-align: center;
}

.kf-ranking-main .kf-stat-label {
    color: rgba(255, 255, 255, .8);
}

.kf-rank-number {
    color: #ffd884;
    font-size: 44px;
    font-weight: 900;
    line-height: 1.2;
}

.kf-stat-caption {
    color: rgba(255, 255, 255, .85);
    font-size: 12px;
}

.kf-ranking-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kf-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 18px 8px;
    text-align: center;
}

.kf-stat-box + .kf-stat-box {
    border-right: 1px solid var(--kf-border);
}

.kf-stat-label {
    color: var(--kf-text-muted);
    font-size: 12px;
    font-weight: 600;
}

.kf-stat-box strong {
    color: var(--kf-primary);
    font-size: clamp(16px, 2.5vw, 22px);
    font-weight: 800;
    word-break: break-word;
}

/* اطلاعات بازیکن */
.kf-profile-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kf-profile-detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius-sm);
    box-shadow: var(--kf-shadow);
}

.kf-profile-label {
    color: var(--kf-text-muted);
    font-weight: 700;
}

/* لینک‌های اجتماعی */
.kf-profile-social {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.kf-social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius-pill);
    color: var(--kf-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: background .15s, border-color .15s, color .15s;
}

.kf-social-link:hover {
    background: var(--kf-accent);
    border-color: var(--kf-accent);
    color: #fff;
}

/* ==============================
   افتخارات
   ============================== */

.kf-achievements {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.kf-achievement {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius-sm);
    box-shadow: var(--kf-shadow);
    transition: transform .2s, box-shadow .2s;
}

.kf-achievement:hover {
    transform: translateY(-2px);
    box-shadow: var(--kf-shadow-hover);
}

.kf-achievement-1 {
    border-right: 4px solid #d4af37;
    background: linear-gradient(to left, #fffbf0, #fff);
}

.kf-achievement-1 .kf-achievement-title {
    color: #8a6928;
}

.kf-achievement-2 {
    border-right: 4px solid #94a3b8;
    background: linear-gradient(to left, #f8fafc, #fff);
}

.kf-achievement-2 .kf-achievement-title {
    color: #475569;
}

.kf-achievement-3 {
    border-right: 4px solid #cd7f32;
    background: linear-gradient(to left, #fff7ed, #fff);
}

.kf-achievement-3 .kf-achievement-title {
    color: #9a5a1e;
}

.kf-achievement-other {
    border-right: 4px solid var(--kf-primary);
    background: #fff;
}

.kf-achievement-other .kf-achievement-title {
    color: var(--kf-primary);
}

.kf-achievement-medal {
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 28px;
    line-height: 1;
}

.kf-achievement-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.kf-achievement-title {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
}

.kf-achievement-event {
    color: var(--kf-text);
    font-size: 13px;
    line-height: 1.7;
    word-break: break-word;
}

.kf-achievement-meta {
    color: var(--kf-text-muted);
    font-size: 11px;
    font-weight: 600;
}

/* ==============================
   ریسپانسیو
   ============================== */

@media (max-width: 992px) {
    .kf-two-cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .kf-public-wrap {
        margin: 24px auto;
        padding: 0 16px;
    }

    .kf-event-card {
        flex-direction: column;
        padding: 16px;
    }

    .kf-event-thumb {
        flex: 0 0 auto;
        width: 100%;
        height: 200px;
    }

    .kf-single-hero {
        flex-direction: column;
        padding: 20px;
    }

    .kf-single-thumb {
        flex: 0 0 auto;
        width: 100%;
        height: 220px;
    }

    .kf-hero {
        padding: 24px 20px;
    }

    .kf-hero-title {
        font-size: 22px;
    }

    .kf-profile-hero {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }

    .kf-profile-avatar {
        flex: 0 0 110px;
        width: 110px;
        height: 110px;
    }

    .kf-profile-meta {
        justify-content: center;
    }

    .kf-ranking-summary {
        grid-template-columns: 1fr;
    }

    .kf-ranking-main {
        padding: 18px 12px;
    }

    /* جدول‌های دو ستونه به کارت */
    .kf-two-cols .kf-table-wrap {
        overflow: visible;
        border: 0;
        box-shadow: none;
        background: transparent;
        border-radius: 0;
    }

    .kf-two-cols .kf-table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0 12px;
        display: block;
    }

    .kf-two-cols .kf-table thead {
        display: none;
    }

    .kf-two-cols .kf-table tbody {
        display: block;
    }

    .kf-two-cols .kf-table tbody tr {
        display: block;
        background: var(--kf-card);
        border: 1px solid var(--kf-border);
        border-radius: var(--kf-radius-sm);
        box-shadow: var(--kf-shadow);
        padding: 14px;
        margin: 0 0 12px;
        overflow: hidden;
    }

    .kf-two-cols .kf-table tbody tr:nth-child(even),
    .kf-two-cols .kf-table tbody tr:hover {
        background: var(--kf-card);
    }

    .kf-two-cols .kf-table tbody td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 0;
        border-bottom: 1px dashed var(--kf-border);
        text-align: right;
        font-size: 13px;
    }

    .kf-two-cols .kf-table tbody td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .kf-two-cols .kf-table tbody td:first-child {
        padding-top: 0;
    }

    .kf-two-cols .kf-table tbody td::before {
        content: attr(data-label);
        display: block;
        color: var(--kf-text-muted);
        font-weight: 700;
        font-size: 11px;
        letter-spacing: .02em;
    }

    .kf-two-cols .kf-table tbody td[data-label=""]::before,
    .kf-two-cols .kf-table tbody td:not([data-label])::before {
        display: none;
    }
}

@media (max-width: 480px) {
    .kf-public-wrap {
        margin: 16px auto;
        padding: 0 12px;
        font-size: 14px;
    }

    .kf-hero {
        padding: 20px 16px;
        border-radius: var(--kf-radius-sm);
    }

    .kf-hero-title {
        font-size: 19px;
        gap: 10px;
    }

    .kf-hero-icon {
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        font-size: 22px;
        border-radius: 10px;
    }

    .kf-event-card {
        padding: 14px;
        gap: 14px;
    }

    .kf-event-thumb {
        height: 180px;
    }

    .kf-event-title {
        font-size: 16px;
    }

    .kf-single-hero {
        padding: 16px;
    }

    .kf-single-thumb {
        height: 180px;
    }

    .kf-single-title {
        font-size: 18px;
    }

    .kf-table {
        font-size: 13px;
        min-width: 460px;
    }

    .kf-table thead th,
    .kf-table tbody td {
        padding: 10px 8px;
        font-size: 12px;
    }

    .kf-tag {
        font-size: 10px;
        padding: 2px 8px;
    }

    .kf-section-title {
        font-size: 16px;
    }

    .kf-section-count {
        font-size: 11px;
    }

    .kf-event-meta {
        gap: 10px;
        font-size: 12px;
    }

    .kf-profile-hero {
        padding: 20px 16px;
    }

    .kf-profile-avatar {
        flex: 0 0 90px;
        width: 90px;
        height: 90px;
    }

    .kf-rank-number {
        font-size: 36px;
    }

    .kf-ranking-stats {
        grid-template-columns: 1fr;
    }

    .kf-stat-box + .kf-stat-box {
        border-right: 0;
        border-top: 1px solid var(--kf-border);
    }

    .kf-achievements {
        grid-template-columns: 1fr;
    }

    .kf-achievement {
        padding: 14px;
        gap: 10px;
    }

    .kf-achievement-medal {
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
        font-size: 24px;
    }
}

@media (max-width: 360px) {
    .kf-public-wrap {
        padding: 0 8px;
    }

    .kf-hero-title {
        font-size: 17px;
    }

    .kf-event-card {
        padding: 12px;
    }

    .kf-table {
        min-width: 420px;
    }
}


/* ==============================
   فرم فیلتر رده‌بندی
   ============================== */

.kf-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    padding: 20px;
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius);
    box-shadow: var(--kf-shadow);
}

.kf-filter-field {
    display: flex;
    flex: 1 1 160px;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.kf-filter-field label {
    color: var(--kf-text-muted);
    font-size: 13px;
    font-weight: 700;
}

.kf-filter-field select {
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius-sm);
    color: var(--kf-text);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}

.kf-filter-field select:focus {
    outline: 2px solid var(--kf-accent);
    outline-offset: 1px;
    border-color: var(--kf-accent);
}

.kf-submit-button {
    min-height: 42px;
    padding: 10px 22px;
    background: var(--kf-accent);
    color: #fff;
    border: 0;
    border-radius: var(--kf-radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    flex: 0 0 auto;
}

.kf-submit-button:hover {
    background: var(--kf-accent-dark);
}

.kf-submit-button:focus {
    outline: 2px solid var(--kf-accent-dark);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .kf-filter-form {
        padding: 16px;
        gap: 12px;
    }

    .kf-filter-field {
        flex: 1 1 100%;
    }

    .kf-submit-button {
        width: 100%;
    }
}

/* رده‌بندی: ردیف‌های برتر */
.kf-ranking-table tbody tr.kf-place-1 {
    background: #fff8e6 !important;
}

.kf-ranking-table tbody tr.kf-place-2 {
    background: #f1f5f9 !important;
}

.kf-ranking-table tbody tr.kf-place-3 {
    background: #fff3e8 !important;
}

.kf-ranking-table tbody tr.kf-place-1:hover {
    background: #ffefc2 !important;
}

.kf-ranking-table tbody tr.kf-place-2:hover {
    background: #e5ecf3 !important;
}

.kf-ranking-table tbody tr.kf-place-3:hover {
    background: #ffe4d1 !important;
}