/* ===== Races Page ===== */

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

/* ===== Race Hero Banner ===== */
.race-hero {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 32px;
    border: 1px solid rgba(163, 38, 255, 0.45);
    box-shadow: 0 0 24px rgba(163, 38, 255, 0.15), inset 0 0 60px rgba(163, 38, 255, 0.05);
    min-height: 160px;
}

.race-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a0a35 0%, #2d1054 30%, #1a0830 60%, #0d0d0d 100%);
}

.race-hero-waves {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background:
        radial-gradient(ellipse 80% 60% at 20% 80%, rgba(163,38,255,0.4) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 20%, rgba(163,38,255,0.3) 0%, transparent 50%);
}

.race-hero-waves::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 50 Q25 30 50 50 T100 50' fill='none' stroke='rgba(163,38,255,0.15)' stroke-width='1'/%3E%3Cpath d='M0 70 Q25 50 50 70 T100 70' fill='none' stroke='rgba(163,38,255,0.1)' stroke-width='1'/%3E%3C/svg%3E") repeat;
    background-size: 200px 100px;
}

.race-hero-inner {
    position: relative;
    display: flex;
    align-items: center;
    padding: 28px 32px;
    min-height: 160px;
    z-index: 1;
}

.race-hero-left {
    flex: 1;
}

.race-hero-title {
    display: flex;
    flex-direction: column;
    line-height: 1;
    font-style: italic;
}

.race-amount {
    font-size: 42px;
    font-weight: 900;
    font-style: italic;
    background: linear-gradient(180deg, #fff 0%, #fcd34d 60%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 8px rgba(251, 191, 36, 0.3));
    letter-spacing: -0.02em;
}

.race-label {
    font-size: 28px;
    font-weight: 900;
    font-style: italic;
    color: #fff;
    margin-top: 6px;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 12px rgba(255,255,255,0.15);
}

.race-hero-right {
    flex-shrink: 0;
    text-align: center;
    margin-right: 120px;
}

.race-countdown-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #fbbf24;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.race-countdown {
    display: flex;
    gap: 8px;
}

.countdown-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 58px;
    padding: 8px 10px 6px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(251, 191, 36, 0.5);
    border-radius: 8px;
}

.countdown-val {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.countdown-unit {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-top: 4px;
    text-transform: uppercase;
}

.race-hero-flag {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    filter: drop-shadow(4px 8px 16px rgba(0,0,0,0.5));
}

.race-hero-flag img {
    width: 130px;
    height: auto;
}

/* ===== Podium ===== */
.podium-section {
    margin-bottom: 28px;
}

.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
    padding: 0 20px;
}

.podium-card {
    position: relative;
    flex: 0 0 200px;
    border-radius: 14px;
    background: #1e1e1e;
    overflow: visible;
}

.podium-rank-1 {
    flex: 0 0 220px;
    order: 2;
    z-index: 2;
}

.podium-rank-2 {
    order: 1;
}

.podium-rank-3 {
    order: 3;
}

.podium-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 14px 14px 0 0;
}

.glow-1 {
    background: linear-gradient(90deg, transparent, #fbbf24, #f59e0b, #fbbf24, transparent);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.6), 0 -2px 12px rgba(251, 191, 36, 0.3);
}

.glow-2 {
    background: linear-gradient(90deg, transparent, #60a5fa, #3b82f6, #60a5fa, transparent);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.5);
}

.glow-3 {
    background: linear-gradient(90deg, transparent, #fb923c, #ea580c, #fb923c, transparent);
    box-shadow: 0 0 16px rgba(234, 88, 12, 0.5);
}

.podium-ribbon {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 18px 8px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    border-radius: 0 0 8px 8px;
    z-index: 3;
    white-space: nowrap;
    clip-path: polygon(0 0, 100% 0, 92% 100%, 8% 100%);
}

.ribbon-1 {
    background: linear-gradient(180deg, #fbbf24, #d97706);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.ribbon-2 {
    background: linear-gradient(180deg, #60a5fa, #2563eb);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.ribbon-3 {
    background: linear-gradient(180deg, #fb923c, #c2410c);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.4);
}

.podium-body {
    padding: 32px 20px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.podium-rank-1 .podium-body {
    padding: 36px 20px 28px;
    min-height: 280px;
}

.podium-rank-2 .podium-body,
.podium-rank-3 .podium-body {
    min-height: 240px;
}

.podium-avatar-wrap {
    margin-bottom: 12px;
}

.podium-avatar {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.08);
}

.podium-rank-1 .podium-avatar,
.podium-rank-1 .fortune-chip {
    width: 80px;
    height: 80px;
}

.fortune-chip {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fortune-chip img {
    width: 100%;
    height: 100%;
}

.podium-user {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 14px;
}

.vip-badge {
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.podium-wagered {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 16px;
}

.wagered-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: #6b7280;
    text-transform: uppercase;
}

.wagered-amount {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.podium-prize-btn {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 50%, #d97706 100%);
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 800;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.podium-prize-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.45);
}

/* ===== Leaderboard Table ===== */
.leaderboard-section {
    margin-top: 8px;
}

.leaderboard-table {
    background: transparent;
}

.lb-header {
    display: grid;
    grid-template-columns: 60px 1fr minmax(120px, 1fr) minmax(90px, 120px);
    padding: 12px 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #6b7280;
    text-transform: uppercase;
}

.lb-row {
    display: grid;
    grid-template-columns: 60px 1fr minmax(120px, 1fr) minmax(90px, 120px);
    align-items: center;
    padding: 14px 20px;
    background: #161616;
    border-radius: 10px;
    margin-bottom: 6px;
    transition: background 0.15s;
}

.lb-row:hover {
    background: #1c1c1c;
}

.lb-col-rank {
    display: flex;
    align-items: center;
}

.rank-hex {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #9ca3af;
    font-size: 13px;
    font-weight: 800;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.lb-col-player {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lb-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.lb-username {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.lb-col-wagered {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-align: right;
}

.lb-col-prize {
    font-size: 14px;
    font-weight: 800;
    color: #fbbf24;
    text-align: right;
}

.lb-header .lb-col-wagered,
.lb-header .lb-col-prize {
    text-align: right;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .race-hero-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 24px 20px 80px;
    }

    .race-hero-right {
        margin-right: 0;
    }

    .race-hero-flag {
        right: 16px;
        bottom: 16px;
        top: auto;
        transform: none;
    }

    .race-hero-flag img {
        width: 80px;
    }

    .race-amount { font-size: 32px; }
    .race-label { font-size: 22px; }

    .podium {
        flex-direction: column;
        align-items: center;
    }

    .podium-card,
    .podium-rank-1 {
        flex: none;
        width: 100%;
        max-width: 280px;
        order: unset !important;
    }

    .podium-rank-1 .podium-body,
    .podium-rank-2 .podium-body,
    .podium-rank-3 .podium-body {
        min-height: auto;
    }

    .lb-header,
    .lb-row {
        grid-template-columns: 44px 1fr minmax(72px, 1fr) minmax(64px, 80px);
        padding: 12px 14px;
        font-size: 12px;
    }

    .lb-col-wagered,
    .lb-col-prize {
        font-size: 12px;
    }
}
