:root {
    --primary-color: #e67e22; /* Orange */
    --secondary-color: #d0d0d0; /* Grey */
    --accent-color: white; /* White */
    --hover-color: #f5a623; /* Light Orange */
    --text-color-primary: white; /* White */
    --text-color-secondary: #c9c9c9; /* Dark Gray */
    --text-color-black: black; /* Black */
}

/* General Container */
.rankings-container {
    max-width: 100%;
    margin: 20px auto;
    font-family: Arial, sans-serif;
    padding: 15px;
    border-radius:  20px;
}

/* Table Styling */
.rankings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

    /* Table Headers */
    .rankings-table th {
        background: var(--primary-color);
        color: var(--text-color-primary);
        font-size: 13px;
        text-transform: uppercase;
        padding: 12px;
        letter-spacing: 1px;
        vertical-align: middle
    }


    /* Table Cells */
    .rankings-table td {
        /* border-bottom: 1px solid var(--secondary-color);*/
        padding: 12px;
        text-align: center;
        font-size: 14px;
        color: var(--text-color-black);
        vertical-align: middle
    }

    td, th {
            border: 1px solid transparent !important;
    }

/* Alternate Row Colors */
.rankings-table tbody tr:nth-child(even) {
    background: var(--secondary-color);
}

    .rankings-table tbody tr:nth-child(odd) {
        background: var(--accent-color);
    }

    /* Hover Effect */
    .rankings-table tbody tr:hover {
        background-color: var(--hover-color);
        color: var(--text-color-primary);
        transition: background-color 0.3s;
        cursor: pointer;
    }

    table tbody tr:hover > td, table tbody tr:hover > th {
        color: var(--text-color-primary);
    }

/* Rounded corners for the first and last table rows */
.rankings-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 10px;
}

    .rankings-table tbody tr:last-child td:last-child {
        border-bottom-right-radius: 10px;
    }

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
    .rankings-table {
        font-size: 12px;
    }

        .rankings-table th, .rankings-table td {
            padding: 8px;
        }
}


/* 📱 Mobile-Friendly - Scrollable Table with Sticky Headers */
@media screen and (max-width: 768px) {
    .rankings-container {
        width: 100%;
        overflow-x: auto; /* Allows horizontal scrolling */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS */
    }

    .rankings-table {
        min-width: 320px; /* Ensures table doesn't shrink too much */
    }

        .rankings-table th, .rankings-table td {
            font-size: 12px; /* Adjust font size */
            padding: 6px;
            white-space: nowrap; /* Prevents text wrapping */
        }

        /* Sticky Headers */
        .rankings-table thead {
            position: sticky;
            top: 0;
            background-color: var(--primary-color);
            z-index: 2;
        }
}

/* 📱 Even Smaller Screens (e.g., 480px) */
@media screen and (max-width: 480px) {
    .rankings-table th, .rankings-table td {
        font-size: 11px;
        padding: 5px;
    }
}

img.race-icon {
    height: 30px !important;
}

.class-tooltip {
    position: relative;
    display: inline-block;
    z-index: 2;
}

.tooltip-text {
    visibility: hidden;
    background-color: rgba(0, 0, 0, 0.75);
    color: #fff;
    text-align: center;
    padding: 5px 10px;
    border-radius: 5px;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.class-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.rank-pagination {
    text-align: center;
    margin: 20px 0;
}

.rank-pagination a,
.rank-pagination span {
        display: inline-block;
        padding: 8px 12px;
        margin: 2px;
        border-radius: 5px;
        font-weight: bold;
        text-decoration: none;
        transition: background-color 0.3s, color 0.3s;
    }

    .rank-pagination a {
        color: var(--primary-color);
        border: 2px solid var(--primary-color);
        background-color: var(--text-color-primary);
    }

        .rank-pagination a:hover {
            background-color: var(--primary-color);
            color: var(--text-color-primary);
        }

    .rank-pagination .current {
        background-color: var(--primary-color);
        color: var(--text-color-primary);
        border: 2px solid var(--primary-color);
    }

    .rank-pagination .dots {
        color: var(--primary-color);
        padding: 8px 12px;
        font-weight: bold;
    }

.custom-tab-buttons {
    display: flex;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.custom-tab-button {
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: var(--text-color-primary);
    border-radius: 5px;
    margin: 0 10px;
    transition: 0.3s;
}

    .custom-tab-button:hover, .custom-tab-button.active {
        background: var(--primary-color);
        color: var(--text-color-primary);
    }


/* Custom styling for the dropdown filters */
.budokai-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--primary-color);
    padding: 10px;
    border-radius: 5px;
    max-width: 700px;
    margin: 10px auto;
    justify-content: center;
}

    .budokai-filters label {
        color: var(--text-color-primary);
        font-weight: bold;
    }

    .budokai-filters select {
        background-color: var(--text-color-primary);
        color: var(--primary-color);
        font-weight: bold;
        border: none;
        padding: 8px;
        border-radius: 5px;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        width: 200px;
    }

        .budokai-filters select:focus {
            outline: none;
            box-shadow: 0 0 5px rgba(75, 79, 127, 0.8);
        }

    .budokai-filters button {
        background-color: var(--text-color-primary);
        color: var(--primary-color) !important;
        font-weight: bold;
        padding: 8px 12px;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        transition: background-color 0.3s, color 0.3s;
    }

        .budokai-filters button:hover {
            background-color: #ddd;
        }

    /* Dropdown Styling */
    .budokai-filters select {
        position: relative;
        padding-right: 30px;
    }

        /* Custom Dropdown Arrow */
        .budokai-filters select::-ms-expand {
            display: none;
        }

        .budokai-filters select::after {
            content: "▼";
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--primary-color);
            pointer-events: none;
        }

.rank-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--primary-color);
    padding: 10px;
    border-radius: 5px;
    max-width: 700px;
    margin: 10px auto;
    justify-content: center;
}

    .rank-filters label {
        color: var(--text-color-primary);
        font-weight: bold;
    }

    .rank-filters select {
        background-color: var(--text-color-primary);
        color: var(--primary-color);
        font-weight: bold;
        border: none;
        padding: 8px;
        border-radius: 5px;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        width: 200px;
    }

        .rank-filters select:focus {
            outline: none;
            box-shadow: 0 0 5px rgba(75, 79, 127, 0.8);
        }

    .rank-filters button {
        background-color: var(--text-color-primary);
        color: var(--primary-color) !important;
        font-weight: bold;
        padding: 8px 12px;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        transition: background-color 0.3s, color 0.3s;
    }

        .rank-filters button:hover {
            background-color: #ddd;
        }

    /* Dropdown Styling */
    .rank-filters select {
        position: relative;
        padding-right: 15px;
    }

        /* Custom Dropdown Arrow */
        .rank-filters select::-ms-expand {
            display: none;
        }

        .rank-filters select::after {
            content: "▼";
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--primary-color);
            pointer-events: none;
        }

/* 📱 Responsive adjustments for mobile */
@media screen and (max-width: 768px) {
    .budokai-filters, .rank-filters {
        flex-direction: column;
        gap: 5px;
        padding: 10px;
        max-width: 90%;
    }

        .budokai-filters select, .rank-filters select,
        .budokai-filters button, .rank-filters button {
            width: 100%; /* Makes buttons and selects full width */
        }
}


/* Top 3 podium cards (second-image style) */
.rb-top3-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 20px;
    padding: 28px 12px 12px;
    flex-wrap: wrap;
}

.rb-top3-card {
    position: relative;
    width: 240px;
    background: #fff;
    border: 1px solid #d8dee6;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(31, 41, 51, 0.08);
    padding: 28px 18px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rb-top3-rank-1 {
    order: 2;
    width: 260px;
    border-color: #f0a03a;
    box-shadow: 0 12px 28px rgba(240, 160, 58, 0.22);
    transform: translateY(-12px);
}

.rb-top3-rank-2 {
    order: 1;
    border-color: #9aa7b5;
}

.rb-top3-rank-3 {
    order: 3;
    border-color: #e28a78;
}

.rb-top3-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 34px;
    height: 28px;
    padding: 0 10px;
    border-radius: 6px 6px 10px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.rb-top3-rank-1 .rb-top3-badge {
    background: linear-gradient(180deg, #ffb347 0%, #f08a1a 100%);
}

.rb-top3-rank-2 .rb-top3-badge {
    background: linear-gradient(180deg, #8f9eae 0%, #667584 100%);
}

.rb-top3-rank-3 .rb-top3-badge {
    background: linear-gradient(180deg, #ef8f6f 0%, #d45b45 100%);
}

.rb-top3-medal-wrap {
    margin: 6px 0 10px;
}

.rb-top3-medal {
    width: 108px;
    height: auto;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18));
}

.rb-top3-rank-1 .rb-top3-medal {
    width: 124px;
}

.rb-top3-title {
    font-size: 20px;
    font-weight: 800;
    color: #1f2a37;
    line-height: 1.2;
    margin-bottom: 2px;
    word-break: break-word;
}

.rb-top3-rank-1 .rb-top3-title {
    color: #e67e22;
}

.rb-top3-subtitle {
    font-size: 13px;
    color: #7a8794;
    margin-bottom: 12px;
}

.rb-top3-stats {
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: 4px;
    margin: 4px 0 12px;
    padding: 8px 0;
    border-top: 1px solid #e8edf2;
    border-bottom: 1px solid #e8edf2;
}

.rb-top3-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    position: relative;
}

.rb-top3-stat + .rb-top3-stat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    bottom: 10%;
    width: 1px;
    background: #e3e8ef;
}

.rb-top3-stat-value {
    font-size: 18px;
    font-weight: 800;
    color: #243040;
    line-height: 1.1;
}

.rb-top3-stat-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8a96a3;
}

.rb-top3-class {
    margin: 4px 0 12px;
}

.rb-top3-class .class-icon {
    width: 42px;
    height: 42px;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.15));
}

.rb-top3-score {
    width: 100%;
    border-radius: 12px;
    padding: 12px 10px;
    margin-top: auto;
}

.rb-top3-rank-1 .rb-top3-score {
    background: #fff3e4;
}

.rb-top3-rank-2 .rb-top3-score {
    background: #eef2f6;
}

.rb-top3-rank-3 .rb-top3-score {
    background: #fdece7;
}

.rb-top3-score-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: #243040;
}

.rb-top3-rank-1 .rb-top3-score-value {
    color: #d97706;
}

.rb-top3-score-label {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8a96a3;
}

/* Legacy class hooks still used by shortcode wrappers */
.ranked-top3-container,
.budokai-top3-container,
.player-top3-container,
.guild-top3-container {
    margin: 0;
    padding: 0;
}

@media screen and (max-width: 900px) {
    .rb-top3-podium {
        align-items: stretch;
    }

    .rb-top3-rank-1,
    .rb-top3-rank-2,
    .rb-top3-rank-3 {
        order: initial;
        transform: none;
        width: min(100%, 280px);
    }
}

@media screen and (max-width: 768px) {
    .rb-top3-podium {
        flex-direction: column;
        align-items: center;
        gap: 24px;
        padding-top: 20px;
    }

    .rb-top3-card,
    .rb-top3-rank-1 {
        width: min(100%, 300px);
    }
}

/* Ensure the footer is centered and adapts to any screen size */
.ranking-footer {
    text-align: left;
    font-size: 10px;
    padding-left: 5px;
    color: #ffffff63;
    margin-top: 0;
    font-family: Arial, sans-serif;
    position: absolute;
}

    /* Style the credit link */
    .ranking-footer a {
        color: #ff4d79;
        text-decoration: none;
        transition: color 0.3s ease;
    }

        .ranking-footer a:hover {
            color: #ff99aa;
        }

/* Mobile-friendly adjustments */
@media screen and (max-width: 768px) {
    .ranking-footer {
        font-size: 12px;
        padding: 5px;
    }

    .rank-pagination {
        margin: 50px 0;
    }
}

.ranking-notice {
    text-align: center;
    color: white;
    font-size: 12px;
}

/* FFXIV-style standings list */
.rb-standings {
    background: #fff;
    border: 1px solid #d8dee6;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    margin-top: 16px;
}

.rb-standings-header {
    display: flex;
    justify-content: flex-end;
    padding: 10px 20px;
    background: #f3f5f8;
    border-bottom: 1px solid #e3e8ef;
}

.rb-standings-metric {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5c6773;
}

.rb-standings-list {
    display: flex;
    flex-direction: column;
}

.rb-standing-row {
    display: grid;
    grid-template-columns: 72px 56px minmax(0, 1fr) minmax(140px, 220px) 120px;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #e8edf2;
    background: #fff;
    transition: background-color 0.2s ease;
}

.rb-standing-row:nth-child(even):not(.rb-standing-row-top) {
    background: #f7f8fa;
}

.rb-standing-row:last-child {
    border-bottom: none;
}

.rb-standing-row:hover {
    background: #f0f4f8;
}

.rb-standing-row-top-1 {
    background: #fff8ef !important;
    box-shadow: inset 3px 0 0 #d45b45;
}

.rb-standing-row-top-2 {
    background: #fff4e8 !important;
    box-shadow: inset 3px 0 0 #f0a03a;
}

.rb-standing-row-top-3 {
    background: #fff5f2 !important;
    box-shadow: inset 3px 0 0 #d45b45;
}

.rb-standing-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: #3a4450;
    text-align: center;
}

.rb-standing-rank-number {
    min-width: 1.1em;
}

.rb-standing-row-top .rb-standing-rank-number {
    display: none;
}

.rb-standing-rank-medal {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.rb-standing-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.rb-avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e3e8ef;
    background: #eef1f4;
    display: block;
}

.rb-standing-info {
    min-width: 0;
}

.rb-standing-name {
    font-size: 18px;
    font-weight: 700;
    color: #1f2933;
    line-height: 1.25;
    margin-bottom: 2px;
}

.rb-standing-name-link {
    color: inherit;
    text-decoration: none;
}

.rb-standing-name-link:hover {
    color: var(--primary-color);
}

.rb-standing-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7785;
    line-height: 1.3;
}

.rb-standing-submeta {
    margin-top: 2px;
    padding-left: 0;
}

.rb-standing-meta-icon {
    width: 16px;
    height: 16px;
    font-size: 16px;
    color: #8a96a3;
}

.rb-standing-class {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.rb-standing-class-with-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.rb-standing-class-name {
    font-size: 14px;
    font-weight: 600;
    color: #3a4450;
    line-height: 1.2;
    white-space: nowrap;
}

.rb-standing-class .class-icon {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}

.rb-class-fallback {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: #3a4450;
}

.rb-guild-dojo-icon {
    width: 28px;
    height: 28px;
    font-size: 28px;
    line-height: 1;
}

.rb-guild-dojo.is-yes .rb-guild-dojo-icon,
.rb-guild-dojo.is-yes .rb-standing-class-name {
    color: #1f7a46;
}

.rb-guild-dojo.is-no .rb-guild-dojo-icon,
.rb-guild-dojo.is-no .rb-standing-class-name {
    color: #b42318;
}

.rb-standing-score {
    text-align: right;
}

.rb-score-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: #2f3944;
}

.rb-score-label {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #8a96a3;
}

.rb-standings-filters {
    background: #f3f5f8 !important;
    border: 1px solid #d8dee6;
    max-width: none !important;
}

.rb-standings-filters label {
    color: #3a4450 !important;
}

.rb-standings-filters select,
.rb-standings-filters input[type="text"] {
    color: #2f3944 !important;
    border: 1px solid #c8d0da !important;
}

.rb-standings-filters button {
    background: var(--primary-color) !important;
    color: #fff !important;
}

.rankings-container .rb-standings + .ranking-footer {
    position: static;
    margin-top: 12px;
    color: #8a96a3;
}

@media screen and (max-width: 768px) {
    .rb-standing-row {
        grid-template-columns: 56px 44px minmax(0, 1fr) minmax(110px, 1fr) 72px;
        gap: 8px;
        padding: 12px 10px;
    }

    .rb-standing-rank-medal {
        width: 36px;
        height: 36px;
    }

    .rb-standing-rank,
    .rb-score-value {
        font-size: 22px;
    }

    .rb-standing-name {
        font-size: 15px;
    }

    .rb-standing-meta {
        font-size: 12px;
    }

    .rb-standing-class .class-icon {
        width: 34px;
        height: 34px;
    }

    .rb-standing-class-name {
        font-size: 12px;
        white-space: normal;
    }

    .rb-score-label {
        display: none;
    }
}

/* Elementor: align-items:center shrinks widgets to content width.
   Force Rankboard to stretch the full container instead. */
.rb-rankboard-root,
.rb-top3-podium,
.rankings-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.elementor-element:has(.rb-rankboard-root),
.elementor-element:has(.rb-top3-podium),
.elementor-element:has(.rankings-container),
.elementor-widget-container:has(.rb-rankboard-root),
.elementor-widget-container:has(.rb-top3-podium),
.elementor-widget-container:has(.rankings-container) {
    width: 100% !important;
    max-width: 100% !important;
    align-self: stretch !important;
}