/* ===== Rewards Page — Webrace ===== */

.rewards-page {
    width: 100%;
    max-width: none;
    padding: 4px 32px 0;
    box-sizing: border-box;
}

/* Neutralize the global `svg { width:100%; height:100% }` rule */
.rewards-page svg {
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    flex-shrink: 0;
}

/* ===== Header band ===== */
.rewards-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    margin-bottom: 16px;
    background: #1a1830;
    border: 1px solid rgba(168, 85, 247, 0.18);
    border-radius: 12px;
}

.rewards-header__title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rewards-header__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rewards-header h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.01em;
}

.rewards-header__reload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 600;
}

.rewards-header__reload-amount {
    color: #fff;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.rewards-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}

.rewards-info-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #d4d4d8;
}

/* ===== 5 reward boxes ===== */
.rewards-boxes {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    padding: 18px;
    margin-bottom: 16px;
    background: #1a1830;
    border: 1px solid rgba(168, 85, 247, 0.18);
    border-radius: 12px;
}

.reward-box {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 14px 12px;
    background: linear-gradient(180deg, #221a3a 0%, #1a1530 100%);
    border: 1px solid rgba(168, 85, 247, 0.18);
    border-radius: 10px;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.reward-box:not(.reward-box--locked):hover {
    transform: translateY(-2px);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 6px 18px -6px rgba(168, 85, 247, 0.35);
}

.reward-box--locked {
    background: #161429;
    border-color: rgba(255, 255, 255, 0.04);
}

.reward-box__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.reward-box__label {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
}

.reward-box--locked .reward-box__label {
    color: #9ca3af;
}

.reward-box__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 96px;
    padding: 6px 0;
}

.reward-box__btn {
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(180deg, #a855f7 0%, #7c3aed 100%);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.reward-box__btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.45);
}

.reward-box__btn--locked {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #6b7280;
    box-shadow: none;
    cursor: not-allowed;
    font-weight: 600;
}

.reward-box__btn--locked:hover {
    transform: none;
    filter: none;
    box-shadow: none;
}

.reward-box__requires {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #cbd5e1;
    font-weight: 700;
}

/* ===== Rank Progress card ===== */
.rank-progress {
    padding: 18px 20px;
    margin-bottom: 16px;
    background: #1a1830;
    border: 1px solid rgba(168, 85, 247, 0.18);
    border-radius: 12px;
}

.rank-progress__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.rank-progress__title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rank-progress__title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}

.rank-progress__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rank-progress__claim {
    padding: 8px 14px;
    background: rgba(168, 85, 247, 0.12);
    color: #c4a3f5;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 8px;
    cursor: not-allowed;
    opacity: 0.7;
    transition: background 0.15s, color 0.15s;
}

.rank-progress__claim:not(:disabled) {
    background: linear-gradient(180deg, #a855f7 0%, #7c3aed 100%);
    color: #fff;
    border-color: transparent;
    cursor: pointer;
    opacity: 1;
}

.rank-progress__view-all {
    padding: 8px 14px;
    background: #25223b;
    color: #d4d4d8;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}

.rank-progress__view-all:hover {
    background: #2d2945;
    color: #fff;
}

.rank-progress__body {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: center;
}

.rank-progress__left {
    min-width: 0;
}

.rank-progress__bar {
    position: relative;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    overflow: hidden;
}

.rank-progress__bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #a855f7 0%, #c084fc 100%);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.rank-progress__bar-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.rank-progress__current,
.rank-progress__next {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #9ca3af;
}

.rank-progress__next {
    color: #c4a3f5;
}

.rank-progress__stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 700;
    color: #d4d4d8;
}

.rank-progress__wagered-total {
    color: #6b7280;
    font-weight: 600;
    margin-left: 4px;
}

.rank-progress__percent {
    color: #9ca3af;
    font-weight: 600;
}

/* Compact rank ladder strip (next 5 ranks) */
.rank-progress__strip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    background: #221a3a;
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 10px;
}

.rank-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 56px;
}

.rank-step__badge {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-step__label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.rank-step__label--bronze   { color: #f59e0b; }
.rank-step__label--silver   { color: #cbd5e1; }
.rank-step__label--gold     { color: #fcd34d; }
.rank-step__label--platinum { color: #a5f3fc; }
.rank-step__label--diamond  { color: #c4b5fd; }

.rank-step__sep {
    display: inline-flex;
    align-items: center;
    color: #4b5563;
    margin-bottom: 16px;
}

/* ===== Total Rewards row ===== */
.rewards-totals {
    display: grid;
    grid-template-columns: 1.4fr repeat(7, 1fr);
    gap: 0;
    background: #1a1830;
    border: 1px solid rgba(168, 85, 247, 0.18);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 32px;
}

.rewards-total {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 16px 18px;
    background: transparent;
    color: #9ca3af;
    text-align: left;
    font-family: inherit;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.rewards-total:last-child {
    border-right: none;
}

.rewards-total:hover {
    background: rgba(168, 85, 247, 0.06);
    color: #d4d4d8;
}

.rewards-total.active {
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.18) 0%, rgba(168, 85, 247, 0.04) 100%);
    box-shadow: inset 3px 0 0 #a855f7;
    color: #fff;
}

.rewards-total--primary {
    background: rgba(168, 85, 247, 0.08);
}

.rewards-total__label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: inherit;
}

.rewards-total__info {
    display: inline-flex;
    margin-left: 2px;
}

.rewards-total__amount {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.rewards-total:not(.active) .rewards-total__amount {
    color: #d4d4d8;
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
    .rewards-boxes {
        grid-template-columns: repeat(3, 1fr);
    }

    .rank-progress__body {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .rank-progress__strip {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .rank-progress__strip::-webkit-scrollbar { display: none; }

    .rewards-totals {
        grid-template-columns: repeat(4, 1fr);
    }

    .rewards-total {
        border-right: 1px solid rgba(255, 255, 255, 0.04);
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }
}

@media (max-width: 700px) {
    .rewards-page { padding: 4px 16px 0; }

    .rewards-boxes {
        grid-template-columns: repeat(2, 1fr);
        padding: 14px;
        gap: 10px;
    }

    .rank-progress__head {
        flex-direction: column;
        align-items: flex-start;
    }

    .rewards-totals {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 460px) {
    .rewards-boxes {
        grid-template-columns: 1fr;
    }
}
