/* ENT Test — Rating / Leaderboard v2 (gamified) */

.enttest-rating-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px;
}

.enttest-rating-header {
    text-align: center;
    margin-bottom: 20px;
}

.enttest-rating-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

/* ── Scope Chips ── */
.enttest-scope-chips {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.enttest-scope-chip {
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    background: #f0f2f5;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.enttest-scope-chip:hover { background: #e4e7ed; color: #333; }
.enttest-scope-chip.active {
    background: #5B5EA6;
    color: #fff;
    border-color: #5B5EA6;
}

/* ── Period Filters ── */
.enttest-rating-toolbar {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.enttest-rating-filters {
    display: flex;
    gap: 6px;
}

.enttest-rating-filter {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    background: #f0f2f5;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.enttest-rating-filter:hover { background: #e0e4ea; color: #333; text-decoration: none; }
.enttest-rating-filter.active { background: #5B5EA6; color: #fff; }

/* ── User Position Card (enhanced) ── */
.enttest-user-card {
    margin-bottom: 24px;
}

.enttest-user-card-inner {
    background: linear-gradient(135deg, #5B5EA6 0%, #7B7ECC 100%);
    color: #fff;
    border-radius: 14px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.enttest-user-card--gold {
    background: linear-gradient(135deg, #DAA520 0%, #FFD700 50%, #DAA520 100%);
}

.enttest-user-card-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.enttest-user-card-rank {
    font-size: 36px;
    font-weight: 900;
    line-height: 1;
}

.enttest-user-card-score {
    font-size: 16px;
    font-weight: 700;
}

.enttest-user-card-pctl {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 2px;
}

.enttest-user-card-of {
    font-size: 16px;
    opacity: 0.7;
}

.enttest-user-card-gap {
    text-align: center;
    font-size: 13px;
    color: #888;
    margin-top: 8px;
    font-weight: 500;
}

.enttest-user-card-motivation {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    margin-top: 6px;
    padding: 6px 16px;
    border-radius: 8px;
    animation: enttest-motivation-pulse 2s ease-in-out infinite;
}

.enttest-motivation--gold {
    color: #DAA520;
    background: rgba(218, 165, 32, 0.1);
}

.enttest-motivation--silver {
    color: #5B5EA6;
    background: rgba(91, 94, 166, 0.1);
}

@keyframes enttest-motivation-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ── Podium (enhanced) ── */
.enttest-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 28px;
    padding: 0 16px;
}

.enttest-podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px 20px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    width: 140px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: enttest-podium-appear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.enttest-podium-item:hover { transform: translateY(-6px); }

.enttest-podium-gold { order: 2; padding-bottom: 28px; animation-delay: 0.2s; }
.enttest-podium-silver { order: 1; animation-delay: 0.4s; }
.enttest-podium-bronze { order: 3; animation-delay: 0.6s; }

.enttest-podium-current { box-shadow: 0 0 0 2px #5B5EA6, 0 4px 12px rgba(91,94,166,0.2); }

@keyframes enttest-podium-appear {
    from { opacity: 0; transform: scale(0.3) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.enttest-podium-crown {
    margin-bottom: 2px;
    animation: enttest-crown-bounce 1.5s ease-in-out infinite;
}

@keyframes enttest-crown-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.enttest-podium-medal { margin-bottom: 6px; }

.enttest-podium-avatar-wrap {
    position: relative;
    margin-bottom: 8px;
}

.enttest-podium-avatar-wrap::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 3px solid var(--ring-color, #ccc);
}

.enttest-podium-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.enttest-podium-gold .enttest-podium-avatar { width: 68px; height: 68px; }

.enttest-podium-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-align: center;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.enttest-podium-score {
    font-size: 20px;
    font-weight: 800;
    color: #5B5EA6;
    margin-top: 4px;
}

/* ── Table ── */
.enttest-rating-table {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
    transition: opacity 0.2s;
}

.enttest-rating-table-header {
    display: flex;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f0f2f5;
}

.enttest-rating-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s, transform 0.15s;
    position: relative;
}
.enttest-rating-row:last-child { border: none; }
.enttest-rating-row:hover { background: #fafbfc; transform: translateX(2px); }

.enttest-rating-row-current {
    background: #f0f0fa;
}
.enttest-rating-row-current::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #5B5EA6;
    border-radius: 0 2px 2px 0;
}
.enttest-rating-row-current:hover { background: #e8e8f4; }

.enttest-rating-col-rank {
    width: 44px;
    font-weight: 700;
    color: #999;
    font-size: 14px;
    flex-shrink: 0;
}

.enttest-rank-medal { display: inline-flex; }

.enttest-rating-col-name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
    min-width: 0;
}

.enttest-rating-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.enttest-rating-col-location {
    width: 120px;
    font-size: 12px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.enttest-rating-col-score {
    width: 60px;
    text-align: right;
    font-weight: 700;
    color: #5B5EA6;
    font-size: 15px;
    flex-shrink: 0;
}

/* ── Empty ── */
.enttest-rating-empty {
    text-align: center;
    padding: 48px 16px;
    color: #888;
}

/* ── Dark Theme ── */
body.theme-dark .enttest-rating-title { color: #e0e0e0; }
body.theme-dark .enttest-scope-chip { background: #2a2d4a; color: #aaa; border-color: transparent; }
body.theme-dark .enttest-scope-chip:hover { background: #3a3d5a; color: #ccc; }
body.theme-dark .enttest-scope-chip.active { background: #5B5EA6; color: #fff; border-color: #5B5EA6; }
body.theme-dark .enttest-rating-filter { background: #2a2d4a; color: #aaa; }
body.theme-dark .enttest-rating-filter:hover { background: #3a3d5a; color: #ccc; }
body.theme-dark .enttest-rating-filter.active { background: #5B5EA6; color: #fff; }
body.theme-dark .enttest-user-card-inner { background: linear-gradient(135deg, #3a3d6a 0%, #5B5EA6 100%); }
body.theme-dark .enttest-user-card--gold { background: linear-gradient(135deg, #8B6914 0%, #DAA520 50%, #8B6914 100%); }
body.theme-dark .enttest-user-card-gap { color: #777; }
body.theme-dark .enttest-motivation--gold { color: #FFD700; background: rgba(218,165,32,0.15); }
body.theme-dark .enttest-motivation--silver { color: #7B7ECC; background: rgba(123,126,204,0.15); }
body.theme-dark .enttest-podium-item { background: #16213e; }
body.theme-dark .enttest-podium-name { color: #ccc; }
body.theme-dark .enttest-rating-table { background: #16213e; }
body.theme-dark .enttest-rating-table-header { border-color: #2a2d4a; }
body.theme-dark .enttest-rating-row { border-color: #2a2d4a; }
body.theme-dark .enttest-rating-row:hover { background: #1e2545; }
body.theme-dark .enttest-rating-row-current { background: #252850; }
body.theme-dark .enttest-rating-row-current::before { background: #7B7ECC; }
body.theme-dark .enttest-rating-col-name { color: #ccc; }
body.theme-dark .enttest-rating-col-rank { color: #777; }
body.theme-dark .enttest-rating-col-location { color: #666; }
body.theme-dark .enttest-rating-col-score { color: #7B7ECC; }
body.theme-dark .enttest-podium-score { color: #7B7ECC; }
body.theme-dark .enttest-rating-empty { color: #64748b; }
body.theme-dark .enttest-rating-table-header { color: #666; }

/* ── Mobile ── */
@media (max-width: 600px) {
    .enttest-rating-page { padding: 16px 12px; }
    .enttest-scope-chips { gap: 4px; }
    .enttest-scope-chip { padding: 6px 12px; font-size: 12px; }
    .enttest-rating-filters { justify-content: center; flex-wrap: wrap; }
    .enttest-rating-filter { padding: 6px 12px; font-size: 12px; }
    .enttest-user-card-inner { padding: 14px 16px; flex-direction: column; text-align: center; gap: 8px; }
    .enttest-user-card-left { flex-direction: column; gap: 4px; }
    .enttest-user-card-rank { font-size: 28px; }
    .enttest-podium { gap: 6px; }
    .enttest-podium-item { width: 105px; padding: 12px 8px 16px; }
    .enttest-podium-avatar { width: 44px; height: 44px; }
    .enttest-podium-gold .enttest-podium-avatar { width: 56px; height: 56px; }
    .enttest-podium-name { font-size: 11px; max-width: 95px; }
    .enttest-podium-score { font-size: 17px; }
    .enttest-rating-col-location { display: none; }
    .enttest-rating-col-rank { width: 36px; }
    .enttest-rating-col-score { width: 50px; font-size: 13px; }
    .enttest-rating-table { font-size: 13px; }
}

@media (max-width: 400px) {
    .enttest-rating-page { padding: 12px 8px; }
    .enttest-rating-title { font-size: 18px; }
    .enttest-podium { gap: 4px; }
    .enttest-podium-item { width: 92px; padding: 10px 6px 12px; }
    .enttest-podium-avatar { width: 38px; height: 38px; }
    .enttest-podium-gold .enttest-podium-avatar { width: 48px; height: 48px; }
    .enttest-podium-name { font-size: 10px; max-width: 82px; }
    .enttest-podium-score { font-size: 15px; }
    .enttest-user-card-rank { font-size: 24px; }
    .enttest-rating-col-rank { width: 30px; font-size: 12px; }
    .enttest-rating-col-score { width: 40px; font-size: 12px; }
    .enttest-rating-table { font-size: 12px; }
}
