/* ============================================ */
/* STATS PAGE — Guild-themed design             */
/* ============================================ */

.stats-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 0 60px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================ */
/* SECTION CARDS (guild .gld-card style)        */
/* ============================================ */

.stats-card {
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid #009879;
    border-radius: 8px;
    padding: 20px 24px;
}

.stats-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.stats-card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #0d3a3b, #1c4c4e);
    border-radius: 8px;
    font-style: normal;
    font-size: 17px;
    color: #fff;
    line-height: 1;
}

.stats-card-title h3 {
    margin: 0;
    padding: 0;
    font-family: 'Rajdhani', sans-serif !important;
    font-weight: 600;
    font-size: 0.95em;
    color: #4beacc;
    text-transform: uppercase;
    line-height: 1.2;
}

.stats-card-title p {
    margin: 3px 0 0;
    padding: 0;
    font-family: 'Rajdhani', sans-serif !important;
    font-size: 14px !important;
    color: #aaa;
    line-height: 1.4;
}

/* ============================================ */
/* CHART GRID                                   */
/* ============================================ */

.stats-row {
    display: flex;
    gap: 10px;
    margin-bottom: 0;
}

.stats-row > .stats-chart {
    flex: 1;
    min-width: 0;
}

.stats-chart {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(56, 164, 156, 0.15);
    border-radius: 6px;
    padding: 14px;
    position: relative;
    box-sizing: border-box;
}

.stats-chart-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    margin-bottom: 8px;
}

.stats-chart canvas:not(.stats-frame) {
    width: 100% !important;
    height: auto !important;
}

.stats-chart-full {
    width: 100%;
    margin-bottom: 0;
    box-sizing: border-box;
}

/* ============================================ */
/* LAYERED CHARTS (frame + data overlay)        */
/* ============================================ */

.stats-layered {
    position: relative;
}

.stats-frame {
    display: block;
    width: 100% !important;
}

.stats-data-overlay {
    position: absolute;
    display: none;
    pointer-events: none;
}

/* ============================================ */
/* METRICS CARDS (guild .gld-stat style)        */
/* ============================================ */

.stats-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stats-metric-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(56, 164, 156, 0.2);
    border-radius: 6px;
    padding: 12px 18px;
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.stats-metric-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #4beacc;
    line-height: 1.1;
}

.stats-metric-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ============================================ */
/* SHARED LEGEND                                */
/* ============================================ */

.stats-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 10px 0 0;
}

.stats-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
}

.stats-legend-color {
    display: inline-block;
    width: 12px;
    height: 3px;
    border-radius: 1px;
}

/* ============================================ */
/* REALM SWITCHER                               */
/* ============================================ */

.stats-realm-switch {
    display: flex;
    gap: 6px;
}

.stats-realm-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 4px 14px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-realm-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.stats-realm-btn.active[data-realm="albion"] {
    background: rgba(204, 51, 51, 0.2);
    border-color: #cc3333;
    color: #cc3333;
}

.stats-realm-btn.active[data-realm="hibernia"] {
    background: rgba(51, 204, 51, 0.2);
    border-color: #33cc33;
    color: #33cc33;
}

.stats-realm-btn.active[data-realm="midgard"] {
    background: rgba(51, 102, 204, 0.2);
    border-color: #3366cc;
    color: #3366cc;
}

/* ============================================ */
/* WORLDMAP HEATMAP                             */
/* ============================================ */

.stats-heatmap {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(56, 164, 156, 0.15);
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 0;
    box-sizing: border-box;
}

.stats-worldmap-container {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background: #0d1117;
    aspect-ratio: 12 / 5;
}

.stats-worldmap-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.stats-worldmap-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ============================================ */
/* RESPONSIVE                                   */
/* ============================================ */

@media (max-width: 768px) {
    .stats-wrapper {
        padding: 10px 0 40px;
        gap: 12px;
    }
    .stats-card {
        padding: 14px 16px;
    }
    .stats-row {
        flex-direction: column;
    }
    .stats-metrics {
        gap: 8px;
    }
    .stats-metric-card {
        min-width: 90px;
        padding: 10px 12px;
    }
}
