/* History page styles */

/* ─── Hero ────────────────────────────────────────────────── */
.history-hero {
    padding: 80px 0 60px;
    background:
        radial-gradient(ellipse at top center, rgba(0, 212, 170, 0.06) 0%, transparent 60%),
        var(--color-bg);
    text-align: center;
}

.history-eyebrow {
    font-family: monospace;
    font-size: 11px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 20px;
}

.history-hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 18px;
    line-height: 1.2;
}

.history-sub {
    font-size: 16px;
    color: var(--color-text-muted);
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ─── Leaderboard ─────────────────────────────────────────── */
.leaderboard-section {
    padding: 60px 0 50px;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.leaderboard-section h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 6px;
}

.section-sub {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 28px;
}

.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.lb-card {
    background: var(--color-bg-card, #111);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 16px 18px;
}

.lb-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.lb-key {
    font-family: monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: 0.5px;
}

.lb-next {
    font-family: monospace;
    font-size: 12px;
    color: var(--color-accent);
}

.lb-bar-track {
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.lb-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
}

.lb-pct {
    font-family: monospace;
    font-size: 11px;
    color: var(--color-text-muted);
    text-align: right;
}

/* ─── Asset browser ───────────────────────────────────────── */
.milestones-browser {
    padding: 50px 0 100px;
    background: var(--color-bg);
}

.asset-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.asset-tab {
    padding: 7px 14px;
    font-family: monospace;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.asset-tab:hover {
    color: var(--color-text);
    border-color: rgba(255,255,255,0.2);
}

.asset-tab.active {
    color: var(--tc, var(--color-accent));
    border-color: var(--tc, var(--color-accent));
    background: color-mix(in srgb, var(--tc, var(--color-accent)) 8%, transparent);
}

/* ─── Panel header ────────────────────────────────────────── */
.milestone-panel {
    min-height: 200px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.panel-name {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 6px;
}

.panel-status {
    font-size: 13px;
    color: var(--color-text-muted);
}

.panel-status strong {
    color: var(--color-text);
}

.panel-pct {
    color: var(--color-accent);
    font-size: 12px;
    font-family: monospace;
}

/* ─── Tier filter buttons ─────────────────────────────────── */
.tier-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tier-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-family: monospace;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.tier-btn:hover {
    color: var(--color-text);
    border-color: rgba(255,255,255,0.2);
}

.tier-btn.active {
    color: var(--color-text);
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.2);
}

.tier-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ─── Chart ───────────────────────────────────────────────── */
.chart-wrap {
    height: 340px;
    margin-bottom: 32px;
    position: relative;
}

/* ─── Table ───────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
}

.milestone-table {
    width: 100%;
    border-collapse: collapse;
}

.milestone-table thead th {
    font-family: monospace;
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-text-muted);
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
}

.milestone-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.12s ease;
}

.milestone-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

.milestone-table tbody tr.tier-historic {
    background: rgba(255, 215, 0, 0.02);
}

.milestone-table tbody tr.tier-historic:hover {
    background: rgba(255, 215, 0, 0.05);
}

.milestone-table tbody tr.tier-major {
    background: rgba(0, 212, 170, 0.02);
}

.milestone-table tbody tr.tier-major:hover {
    background: rgba(0, 212, 170, 0.04);
}

.milestone-table td {
    padding: 12px 14px;
    font-size: 13px;
    vertical-align: top;
    color: var(--color-text-muted);
}

.col-m {
    white-space: nowrap;
}

.m-val {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
}

.col-d {
    font-family: monospace;
    font-size: 12px;
    color: var(--color-text);
    white-space: nowrap;
}

.col-c {
    font-family: monospace;
    font-size: 12px;
    white-space: nowrap;
}

.col-n {
    font-size: 12px;
    line-height: 1.5;
    max-width: 380px;
}

.tier-badge {
    font-family: monospace;
    font-size: 10px;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border: 1px solid;
    border-radius: 3px;
    white-space: nowrap;
    text-transform: uppercase;
}

.table-empty {
    text-align: center;
    color: var(--color-text-muted);
    font-family: monospace;
    font-size: 13px;
    padding: 40px;
}

.tbl-soon {
    color: rgba(255,255,255,0.2);
}

.btn-small {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-family: monospace;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-small:hover {
    background: var(--color-accent);
    color: #000;
}

/* ─── Loading / empty states ──────────────────────────────── */
.history-loading,
.history-empty {
    text-align: center;
    color: var(--color-text-muted);
    font-family: monospace;
    font-size: 14px;
    padding: 60px 0;
    line-height: 1.8;
}

.history-empty code {
    background: var(--color-bg-card, #111);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 13px;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .panel-header {
        flex-direction: column;
    }

    .chart-wrap {
        height: 260px;
    }

    .leaderboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .milestone-table thead th:nth-child(3),
    .milestone-table td:nth-child(3) {
        display: none;
    }
}

@media (max-width: 480px) {
    .history-hero {
        padding: 50px 0 40px;
    }

    .leaderboard-section {
        padding: 40px 0 36px;
    }

    .milestones-browser {
        padding: 36px 0 70px;
    }

    .chart-wrap {
        height: 220px;
    }

    .milestone-table thead th:nth-child(5),
    .milestone-table td:nth-child(5) {
        display: none;
    }

    .m-val {
        font-size: 13px;
    }
}
