/* --- Base Styles --- */
.omg-leaderboard {
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: #2d3748;
    background: #f5f0e8;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    overflow: visible;
}

/* Header */
.omg-header {
    padding: 24px;
    background-image: url(/wp-content/uploads/geopattern.png), linear-gradient(to left, #003E41, #eac7a1);
    background-image: url(/wp-content/uploads/geopattern.png), -webkit-linear-gradient(right, #003E41, #eac7a1);
    color: white;
    text-align: center;
    border-radius: 16px 16px 0 0;
}

.omg-subtitle {
    margin: 0;
    font-size: 20px;
    text-transform: uppercase;
    font-weight: 700;
    color: #ffffff;
}

/* --- Update Timer --- */
.omg-update-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    background: rgba(0, 0, 0, 0.25);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.omg-timer-label {
    opacity: 0.85;
}

.omg-timer-clock {
    font-family: monospace;
    font-size: 14px;
    font-weight: 700;
    color: #eac7a1;
    min-width: 44px;
    text-align: center;
}

/* Tabs */
.omg-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.omg-tab {
    flex: 1;
    padding: 16px;
    text-align: center;
    text-decoration: none;
    color: #64748b;
    font-weight: 600;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.omg-tab:hover {
    background: rgba(234, 199, 161, 0.2);
}

.omg-tab.active {
    position: relative;
    background: #f5f0e8;
    color: #003E41 !important;
    font-weight: 700;
    border-bottom-color: #eac7a1;
}

.omg-tab.active:after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #eac7a1;
}

/* Content */
.omg-content {
    padding: 16px;
}

.omg-description {
    padding: 12px 16px;
    background: #f5f0e8;
    border-radius: 8px;
    font-size: 16px;
    color: #000;
    margin-bottom: 20px;
}

.omg-description h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #333;
}

/* Filter Row */
.omg-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    background: transparent;
    padding: 0 16px;
    border-radius: 8px;
    box-shadow: none;
}

.omg-month-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #333;
    flex-shrink: 0;
}

.omg-timeframe-select {
    padding: 10px 14px;
    border: 1px solid #50545a;
    border-radius: 8px;
    font-size: 14px;
    background-color: rgba(0, 0, 0, 0.05);
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.omg-timeframe-select:focus {
    border-color: #003E41;
    background-color: #fff;
}

.omg-search {
    flex-grow: 1;
    max-width: 400px;
    position: relative;
}

.omg-search-input {
    width: 100%;
    padding: 12px 16px !important;
    padding-right: 48px !important;
    border: 1px solid #50545a !important;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.05) !important;
}

.omg-search-input:focus {
    outline: none;
    border-color: #003E41 !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(0, 62, 65, 0.1);
}

.omg-search-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
}

/* Player Cards */
.omg-player-card {
    z-index: 1;
    padding: 16px;
    margin-bottom: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform .25s cubic-bezier(.7, .98, .86, .98), box-shadow .25s cubic-bezier(.7, .98, .86, .98), opacity .5s ease-out;
    border-left: 4px solid transparent;
    position: relative;
}

.omg-player-card:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.omg-player-card.top-1 {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    border-left-color: #f44336;
    transform: scale(1.1);
    margin-bottom: 25px;
}

.omg-player-card.top-2 {
    background: linear-gradient(135deg, #f47e36 0%, #e06b1f 100%);
    border-left-color: #f47e36;
    transform: scale(1.07);
    margin-bottom: 22px;
}

.omg-player-card.top-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #a05a1a 100%);
    border-left-color: #cd7f32;
    transform: scale(1.04);
    margin-bottom: 20px;
}

.omg-player-card.top-4 {
    background: linear-gradient(135deg, #b75aff 0%, #9545e6 100%);
    border-left-color: #b75aff;
    transform: scale(1.01);
    margin-bottom: 18px;
}

.omg-player-card.top-1 .omg-player-name,
.omg-player-card.top-1 .omg-rank,
.omg-player-card.top-2 .omg-player-name,
.omg-player-card.top-2 .omg-rank,
.omg-player-card.top-3 .omg-player-name,
.omg-player-card.top-3 .omg-rank,
.omg-player-card.top-4 .omg-player-name,
.omg-player-card.top-4 .omg-rank {
    color: white;
}

.omg-player-card.top-1 .omg-stat-value,
.omg-player-card.top-1 .omg-stat-label,
.omg-player-card.top-2 .omg-stat-value,
.omg-player-card.top-2 .omg-stat-label,
.omg-player-card.top-3 .omg-stat-value,
.omg-player-card.top-3 .omg-stat-label,
.omg-player-card.top-4 .omg-stat-value,
.omg-player-card.top-4 .omg-stat-label {
    color: #ffefc0 !important;
}

.omg-player-grid {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.omg-player-left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 12px;
}

.omg-player-right {
    margin-left: 10px;
    flex-shrink: 0;
}

.omg-player-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    line-height: 1.1;
}

.omg-trophy-badge {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    text-align: center;
    margin-right: 8px;
}

.omg-trophy-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.omg-rank {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #64748b;
    font-size: 25px;
    margin-right: 8px;
    text-align: center;
}

.omg-player-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    margin-right: 4px;
}

.omg-player-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.omg-avatar-default {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #475569;
    font-size: 20px;
}

.omg-player-info {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.omg-player-info:hover {
    text-decoration: underline;
}

.omg-player-name {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.omg-stat-value {
    font-size: 25px;
    font-weight: 700;
    color: #003E41;
}

.omg-stat-label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin-top: 2px;
}

/* Badges */
.omg-stat-duration {
    position: absolute;
    top: -10px;
    left: 12px;
    background: #f5f0e8;
    color: #003E41;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    border: 1px solid #003E41;
    box-shadow: none;
    z-index: 20;
    white-space: nowrap;
}

.omg-player-card.is-me {
    box-shadow: 0 0 0 3px #003E41, 0 4px 12px rgba(0, 62, 65, 0.35) !important;
    position: relative;
    z-index: 15;
}

.omg-player-card.is-me::before {
    content: 'YOU';
    position: absolute;
    top: -10px;
    right: 12px;
    background: #eac7a1;
    color: #003E41;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 12px;
    letter-spacing: 1px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    z-index: 20;
}

.omg-player-card.top-1.is-me,
.omg-player-card.top-2.is-me,
.omg-player-card.top-3.is-me,
.omg-player-card.top-4.is-me {
    box-shadow: 0 0 0 3px #eac7a1, 0 5px 15px rgba(234, 199, 161, 0.5) !important;
}

.omg-player-card.top-1.is-me::before,
.omg-player-card.top-2.is-me::before,
.omg-player-card.top-3.is-me::before,
.omg-player-card.top-4.is-me::before {
    background: #eac7a1;
    color: #003E41;
}

/* Pagination & States */
.omg-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.omg-pagination .page-numbers {
    padding: 8px 16px;
    border-radius: 6px;
    background: #f8fafc;
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.omg-pagination a.page-numbers:hover {
    background: #e2e8f0;
    color: #475569;
}

.omg-pagination .prev,
.omg-pagination .next {
    background-color: #003E41;
    color: white !important;
    border-color: #003E41 !important;
}

.omg-pagination .prev:hover,
.omg-pagination .next:hover {
    background-color: #002a2c !important;
    border-color: #002a2c !important;
}

.omg-pagination .page-numbers.current {
    background: #003E41;
    color: white;
    border-color: transparent;
}

.omg-pagination .page-numbers.dots {
    background: transparent;
    border: none;
}

.omg-empty-state {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    margin: 20px 0;
}

.omg-empty-icon {
    font-size: 50px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.omg-empty-state h3 {
    color: #2d3748;
    margin-bottom: 10px;
}

.omg-empty-state p {
    color: #64748b;
    margin-bottom: 0;
}

/* Loading & Spinner */
.omg-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .omg-leaderboard {
        width: 91vw !important;
        max-width: 91vw !important;
        left: 50%;
        margin-left: -45.5vw !important; 
        position: relative;
        border-radius: 12px !important;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
        overflow: visible !important;
    }
    
    .omg-header {
        border-radius: 12px 12px 0 0 !important;
        padding: 20px 10px !important;
    }
    
    .omg-content {
        padding: 12px 0 !important; 
    }

    .omg-filter-row {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        border-radius: 0;
        margin-bottom: 12px;
    }
    
    .omg-search {
        max-width: 100%;
    }
    
    .omg-title h2 {
        font-size: 20px;
    }
    
    .omg-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .omg-tab {
        min-width: 120px;
        padding: 12px 8px;
        font-size: 14px;
    }

    .omg-stat-duration {
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: -10px !important;
    }

    .omg-player-card:not(.top-1):not(.top-2):not(.top-3):not(.top-4) {
        box-sizing: border-box !important; 
        width: calc(100% - 24px) !important;
        margin: 0 12px 14px 12px !important;
        padding: 12px 16px !important;
        border-radius: 8px !important; 
        transform: scale(1) !important;
        transition: transform .25s ease, box-shadow .25s ease !important;
    }

    .omg-player-card:not(.top-1):not(.top-2):not(.top-3):not(.top-4):hover, 
    .omg-player-card:not(.top-1):not(.top-2):not(.top-3):not(.top-4):active {
        transform: scale(1.04) !important; 
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
        z-index: 10;
    }

    .omg-player-card.top-1 { 
        box-sizing: border-box !important;
        width: 100% !important;
        margin: 0 0 18px 0 !important; 
        transform: scale(1.08) !important; 
        border-radius: 6px !important; 
    }
    .omg-player-card.top-2 { 
        box-sizing: border-box !important;
        width: 100% !important;
        margin: 0 0 16px 0 !important; 
        transform: scale(1.06) !important; 
        border-radius: 6px !important; 
    }
    .omg-player-card.top-3 { 
        box-sizing: border-box !important;
        width: 100% !important;
        margin: 0 0 14px 0 !important; 
        transform: scale(1.04) !important; 
        border-radius: 6px !important; 
    }
    .omg-player-card.top-4 { 
        box-sizing: border-box !important;
        width: 100% !important;
        margin: 0 0 14px 0 !important; 
        transform: scale(1.02) !important; 
        border-radius: 6px !important; 
    }
    
    .omg-player-card.top-1:hover, .omg-player-card.top-1:active { transform: scale(1.10) !important; }
    .omg-player-card.top-2:hover, .omg-player-card.top-2:active { transform: scale(1.09) !important; }
    .omg-player-card.top-3:hover, .omg-player-card.top-3:active { transform: scale(1.08) !important; }
    .omg-player-card.top-4:hover, .omg-player-card.top-4:active { transform: scale(1.07) !important; }
    
    .omg-player-left { gap: 8px; }
    .omg-trophy-badge { width: 32px; height: 32px; margin-right: 4px; }
    .omg-trophy-badge img { object-fit: contain !important; }
    
    .omg-rank {
        min-width: 28px !important; 
        width: auto !important;
        margin-right: 6px;
        font-size: 18px;
        white-space: nowrap;
    }
    
    .omg-player-avatar { width: 32px; height: 32px; margin-left: 0; margin-right: 4px; }
    .omg-player-name { font-size: 15px; }
    .omg-stat-value { font-size: 18px; }
    .omg-stat-label { font-size: 11px; }
    
    .omg-pagination { gap: 4px; padding-bottom: 20px; }
    .omg-pagination .page-numbers { padding: 6px 12px; font-size: 14px; }
    
    .omg-description h2 {
        font-size: 17px !important;
        line-height: 25px !important;
    }

    .omg-pagination .prev .full-text,
    .omg-pagination .next .full-text { display: none; }
    
    .omg-pagination .prev::before { content: "<"; display: inline-block; }
    .omg-pagination .next::after { content: ">"; display: inline-block; }
    
    .omg-pagination .prev,
    .omg-pagination .next {
        min-width: 40px;
        text-align: center;
        padding: 8px 12px;
    }
}

@media (min-width: 481px) {
    .omg-pagination .prev::before,
    .omg-pagination .next::after { display: none; }
}