/* ================================================================
   Offside Zamka – Rezultati / Leaderboard page styles
   Loaded only on: is_page('rezultati')
   Note: shared table base (.oz-rez-table-wrap, .oz-rez-table, etc.)
         is in base.css — loaded on every page.
   ================================================================ */

/* ── Hero ─────────────────────────────────────────────────────── */
.oz-rez-hero {
    background:
        radial-gradient(circle, rgba(255, 255, 255, .055) 1px, transparent 1px),
        linear-gradient(135deg, #111 0%, #1a1a1a 60%, #1f1a00 100%);
    background-size: 26px 26px, 100% 100%;
    padding: 72px 0 56px;
    border-bottom: 1px solid rgba(245, 197, 24, .15);
}

.oz-rez-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 197, 24, .12);
    border: 1px solid rgba(245, 197, 24, .3);
    color: var(--oz-yellow);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 24px;
}

.oz-rez-hero-title {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 900;
    color: #fff;
    margin: 0 0 12px;
}

.oz-rez-hero-sub {
    font-size: 16px;
    color: rgba(255, 255, 255, .55);
    margin: 0;
}

/* ── Body + layout ────────────────────────────────────────────── */
.oz-rez-body {
    background: var(--oz-black);
    padding: 48px 0 80px;
}

.oz-rez-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
}

/* Prevent the main grid cell from expanding past the viewport width.
   Without this, the table's min-content can make the grid cell overflow
   the page and trigger body-level horizontal scroll on mobile. */
.oz-rez-main {
    min-width: 0;
}

/* ── Period tabs ──────────────────────────────────────────────── */
.oz-rez-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.oz-rez-tab {
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .05em;
    color: rgba(255, 255, 255, .5);
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    text-decoration: none;
    transition: all .2s;
}

.oz-rez-tab:hover,
.oz-rez-tab.active {
    background: var(--oz-yellow);
    color: var(--oz-black);
    border-color: var(--oz-yellow);
}

/* ── Podium ───────────────────────────────────────────────────── */
.oz-rez-podium {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
    align-items: end;
}

.oz-rez-podium-card {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    position: relative;
}

.oz-rez-podium-1 {
    background: linear-gradient(160deg, #1e1e1e, #1f1900);
    border-color: var(--oz-yellow);
    padding-top: 28px;
    padding-bottom: 28px;
}

.oz-rez-podium-2 {
    border-color: rgba(192, 192, 192, .3);
}

.oz-rez-podium-3 {
    border-color: rgba(205, 127, 50, .3);
}

.oz-rez-podium-rank {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    color: rgba(255, 255, 255, .4);
    margin-bottom: 12px;
}

.oz-rez-podium-1 .oz-rez-podium-rank {
    color: var(--oz-yellow);
}

.oz-rez-podium-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 24px;
}

.oz-rez-podium-1 .oz-rez-podium-avatar {
    width: 68px;
    height: 68px;
    border: 2px solid var(--oz-yellow);
}

.oz-rez-podium-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.oz-rez-podium-medal {
    font-size: 20px;
    margin-bottom: 6px;
}

.oz-rez-podium-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
}

.oz-rez-podium-score {
    font-size: 18px;
    font-weight: 800;
    color: var(--oz-yellow);
    margin: 0 0 4px;
}

.oz-rez-podium-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, .4);
    margin: 0;
}

/* ── Table column extras (base in base.css) ───────────────────── */
.oz-rez-medal {
    font-size: 20px;
}

.oz-rez-num {
    font-weight: 700;
    color: rgba(255, 255, 255, .5);
}

.oz-rez-td-trend {
    font-size: 18px;
}

.oz-trend-up {
    color: #4caf50;
}

.oz-trend-down {
    color: #f44336;
}

.oz-trend-neutral {
    color: rgba(255, 255, 255, .3);
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.oz-rez-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.oz-rez-widget {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    padding: 20px;
}

.oz-rez-widget--dark {
    background: #161600;
    border-color: rgba(245, 197, 24, .25);
}

.oz-rez-widget-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    color: var(--oz-yellow);
    margin: 0 0 16px;
}

.oz-rez-my-pos {
    display: flex;
    align-items: center;
    gap: 16px;
}

.oz-rez-my-rank {
    font-size: 36px;
    font-weight: 900;
    color: var(--oz-yellow);
    line-height: 1;
}

.oz-rez-my-rank--guest {
    color: rgba(255, 255, 255, .2);
}

.oz-rez-my-pos--guest {
    align-items: flex-start;
}

.oz-rez-my-pos--guest p {
    font-size: 13px;
    color: rgba(255, 255, 255, .5);
    margin: 4px 0 0;
}

.oz-rez-my-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: rgba(255, 255, 255, .6);
}

.oz-rez-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.oz-rez-cat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.oz-rez-cat-list li:last-child .oz-rez-cat-item,
.oz-rez-cat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.oz-rez-cat-num {
    font-size: 14px;
    font-weight: 800;
    color: var(--oz-yellow);
    min-width: 20px;
}

.oz-rez-cat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.oz-rez-cat-info strong {
    font-size: 13px;
    color: #fff;
}

.oz-rez-cat-info span {
    font-size: 11px;
    color: rgba(255, 255, 255, .4);
}

.oz-rez-cat-pts {
    font-size: 13px;
    font-weight: 700;
    color: var(--oz-yellow);
    white-space: nowrap;
}

.oz-rez-challenge-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.4;
}

.oz-rez-share-btns {
    display: flex;
    gap: 10px;
    width: 100%;
}

.oz-rez-share-btns .oz-btn {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow: hidden;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
    .oz-rez-layout {
        grid-template-columns: 1fr;
    }

    .oz-rez-podium {
        grid-template-columns: repeat(3, 1fr);
    }

    .oz-rez-hero {
        padding: 48px 0 36px;
    }

    .oz-rez-body {
        padding: 32px 0 60px;
    }
}

/* Podium compact + tab shrink (table still visible as traditional) */
@media (max-width: 600px) {
    .oz-rez-podium {
        gap: 8px;
    }

    .oz-rez-podium-card {
        padding: 14px 10px;
    }

    .oz-rez-podium-avatar {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .oz-rez-podium-1 .oz-rez-podium-avatar {
        width: 48px;
        height: 48px;
    }

    .oz-rez-podium-name {
        font-size: 12px;
    }

    .oz-rez-podium-score {
        font-size: 14px;
    }

    .oz-rez-podium-meta {
        display: none;
    }

    .oz-rez-podium-medal {
        font-size: 16px;
        margin-bottom: 4px;
    }

    .oz-rez-tab {
        padding: 8px 14px;
        font-size: 12px;
    }
}

/* ── Card layout — replaces the table below 540 px ───────────── */
@media (max-width: 540px) {

    /* Wrapper becomes a plain container; cards handle their own bg */
    .oz-rez-table-wrap {
        background: transparent;
        border: none;
        border-radius: 0;
        overflow: visible;
        padding: 0;
    }

    /* Break table out of table display model */
    .oz-rez-table {
        display: block;
        width: 100%;
    }

    .oz-rez-table thead {
        display: none;
    }

    .oz-rez-table tbody {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    /* Each row = card with a 3-column, 2-row grid */
    .oz-rez-table tbody tr {
        display: grid;
        grid-template-columns: 44px 1fr auto;
        grid-template-rows: auto auto;
        column-gap: 10px;
        row-gap: 0;
        padding: 12px 14px;
        border-radius: 10px;
        background: #1e1e1e;
        border: 1px solid rgba(255, 255, 255, .07);
        width: 100%;
        box-sizing: border-box;
    }

    .oz-rez-table tbody tr.oz-rez-row-top {
        border-color: rgba(245, 197, 24, .2);
        background: linear-gradient(135deg, #1e1e1e 60%, #1e1b00);
    }

    .oz-rez-table tbody tr.oz-rez-row-me {
        background: rgba(245, 197, 24, .07) !important;
        border-color: rgba(245, 197, 24, .35) !important;
    }

    /* Reset all td defaults */
    .oz-rez-table tbody td {
        padding: 0;
        border-bottom: none !important;
        font-size: 13px;
        display: flex;
        align-items: center;
        color: rgba(255, 255, 255, .7);
    }

    /* ── Rank (col 1) — spans both rows, centred ── */
    .oz-rez-table td.oz-rez-td-rank {
        grid-column: 1;
        grid-row: 1 / 3;
        justify-content: center;
        font-size: 22px;
        color: rgba(255, 255, 255, .5);
    }



    /* ── Score (col 4) — row 1, right ── */
    .oz-rez-table td.oz-rez-td-score {
        grid-column: 3;
        grid-row: 1;
        justify-content: flex-end;
        font-size: 15px;
        font-weight: 800;
        white-space: nowrap;
        color: var(--oz-yellow) !important;
    }

    /* ── Quizzes played (col 3) — row 2, left ── */
    .oz-rez-table tbody td:nth-child(3) {
        grid-column: 2;
        grid-row: 2;
        font-size: 11px;
        color: rgba(255, 255, 255, .35);
        align-items: flex-start;
        padding-top: 3px;
    }

    .oz-rez-table tbody td:nth-child(3)::after {
        content: '\00a0kviza';
    }

    /* ── Accuracy (col 5) — row 2, right ── */
    .oz-rez-table tbody td:nth-child(5) {
        grid-column: 3;
        grid-row: 2;
        font-size: 11px;
        color: rgba(255, 255, 255, .35);
        justify-content: flex-end;
        align-items: flex-start;
        padding-top: 3px;
    }

    /* hide trend — not useful at card size */
    .oz-rez-table tbody td:nth-child(6) {
        display: none !important;
    }

    /* disable hover — touch devices don't need it */
    .oz-rez-table tbody tr:hover {
        background: #1e1e1e;
    }

    .oz-rez-table tbody tr.oz-rez-row-top:hover {
        background: linear-gradient(135deg, #1e1e1e 60%, #1e1b00);
    }

    .oz-rez-table tbody tr.oz-rez-row-me:hover {
        background: rgba(245, 197, 24, .07) !important;
    }
}

/* Podium → horizontal scroll on very small screens */
@media (max-width: 420px) {
    .oz-rez-podium {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .oz-rez-podium-card {
        flex: 0 0 130px;
        min-width: 130px;
    }
}