/* ── The Crime Board — Leaderboard Page CSS ── */

.lb-page {
    min-height: calc(100vh - 60px);
    padding-bottom: 60px;
}

/* ── Page Header — shared pattern ── */
.page-header {
    border-bottom: 1px solid var(--border);
    padding: 40px 0 32px;
    position: relative;
    overflow: hidden;
}
.page-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--red), transparent);
}
.page-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(194,59,59,0.04) 0%, transparent 60%);
    pointer-events: none;
}
.header-kicker {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 8px;
}
.page-header h1 {
    font-family: var(--serif);
    font-size: clamp(24px, 3.5vw, 38px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 10px;
}
.page-header .sub {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 560px;
}
@media (max-width: 480px) {
    .page-header { padding: 28px 0 24px; }
}

/* ── Container ── */
.lb-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px 0;
}

@media (max-width: 640px) {
    .lb-container { padding: 20px 16px 0; }
}

/* ── Sections ── */
.lb-section {
    margin-bottom: 48px;
}
.lb-section-header {
    margin-bottom: 20px;
}
.lb-section-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.lb-section-title {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.lb-section-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 10px;
    border-radius: 20px;
}
.lb-section-badge-free {
    background: rgba(72,187,120,0.14);
    color: #48bb78;
}
.lb-section-badge-premium {
    background: rgba(201,168,76,0.16);
    color: #c9a84c;
}
.lb-section-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
    max-width: 640px;
}
.lb-section-desc strong {
    color: var(--text);
    font-weight: 600;
}

/* ── Steps Row (horizontal flow) ── */
.lb-steps-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.lb-step-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}
.lb-step-item:not(:last-child) {
    border-right: 1px solid var(--border);
}
.lb-step-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(194,59,59,0.12);
    color: var(--red);
    font-size: 12px;
    font-weight: 800;
    border-radius: 50%;
}
.lb-step-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.lb-step-body strong {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}
.lb-step-body span {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}
.lb-step-arrow {
    display: none;
}

@media (max-width: 700px) {
    .lb-steps-row {
        flex-direction: column;
    }
    .lb-step-item:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .lb-step-item { padding: 12px 16px; }
}

/* ── Rank legend ── */
.lb-rank-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}
.lb-rank-chip {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
    user-select: none;
}
.lb-rank-chip:hover {
    transform: scale(1.05);
}
.lb-chip-active {
    box-shadow: 0 0 0 2px currentColor;
}
.lb-chip-dim {
    opacity: 0.35;
}

/* rank chip colours */
.lb-badge-board_master   { background: rgba(245,158,11,0.18); color: #f59e0b; }
.lb-badge-analyst        { background: rgba(224,122,47,0.18); color: #e07a2f; }
.lb-badge-lead_detective { background: rgba(155,93,229,0.18); color: #9b5de5; }
.lb-badge-detective      { background: rgba(74,139,110,0.18); color: #4a8b6e; }
.lb-badge-investigator   { background: rgba(56,139,253,0.18); color: #388bfd; }
.lb-badge-observer       { background: rgba(107,114,128,0.18); color: #9ca3af; }
.lb-badge-civilian       { background: rgba(107,114,128,0.12); color: #6b7280; }

/* shared badge class used inline in tables */
.lb-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    vertical-align: middle;
}

/* ── Card ── */
.lb-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.lb-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border);
    gap: 8px;
}

.lb-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.lb-card-controls { flex-shrink: 0; }

.lb-filter-select {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
    max-width: 200px;
    appearance: auto;
}

.lb-filter-select:focus {
    outline: none;
    border-color: var(--red);
}

/* ── Pins CTA ── */
.lb-pins-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(201,168,76,0.06) 0%, rgba(201,168,76,0.02) 100%);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 10px;
}
.lb-pins-cta-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.lb-pins-cta-text strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.lb-pins-cta-text span {
    font-size: 12px;
    color: var(--text-muted);
}
.lb-pins-cta-btn {
    flex-shrink: 0;
    background: #c9a84c;
    color: #0d0f14;
    border: none;
    padding: 8px 24px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.lb-pins-cta-btn:hover {
    background: #d4b85a;
    transform: translateY(-1px);
}

/* ── Pins section divider ── */
.lb-section-pins {
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
    .lb-pins-cta { flex-direction: column; text-align: center; }
    .lb-section-title { font-size: 19px; }
}

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

.lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.lb-table thead th {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--surface-2);
    text-align: left;
    white-space: nowrap;
}

.lb-th-num { width: 36px; text-align: center !important; }
.lb-th-r   { text-align: right !important; }

.lb-table tbody tr {
    border-top: 1px solid var(--border);
    transition: background 0.15s;
}

.lb-table tbody tr:hover {
    background: var(--surface-2);
}

.lb-td-num {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding: 10px 12px;
    font-variant-numeric: tabular-nums;
    width: 36px;
}

.lb-td-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
}

/* For <td> layout — use flex via display on the whole td */
.lb-table td.lb-td-user {
    display: table-cell;
    vertical-align: middle;
}

.lb-td-user-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lb-table td {
    padding: 10px 12px;
    color: var(--text);
    vertical-align: middle;
}

.lb-td-r {
    text-align: right;
    white-space: nowrap;
}

.lb-td-loading,
.lb-td-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 24px 12px !important;
    font-size: 13px;
}

/* ── User cell elements ── */
.lb-av {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    vertical-align: middle;
}

.lb-av-init {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.lb-uname {
    font-weight: 500;
    font-size: 13px;
    color: var(--text);
}

.lb-mono {
    font-family: var(--mono);
    font-size: 12px;
    color: #f59e0b;
    font-weight: 600;
}

.lb-muted {
    color: var(--text-muted);
    font-size: 12px;
}

/* ── Pins Shop (matches player style) ── */
.pins-shop-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 999;
}
.pins-shop {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90%; max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    z-index: 1000;
    padding: 24px 20px;
    overflow-y: auto;
    max-height: 90vh;
}
.pins-shop-inner { width: 100%; }
.pins-shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.pins-shop-header span {
    font-size: 16px; font-weight: 800;
    color: #c9a84c;
    letter-spacing: 0.5px;
}
.pins-shop-close {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer; font-size: 14px;
    transition: all 0.15s;
}
.pins-shop-close:hover { background: var(--surface-3); color: var(--text); }
.pins-shop-packages {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.pins-pkg {
    display: flex; flex-direction: column; align-items: center;
    gap: 2px; padding: 14px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer; transition: all 0.2s;
    position: relative; text-align: center;
    color: var(--text); font-family: inherit;
}
.pins-pkg:hover {
    border-color: #c9a84c;
    background: rgba(201,168,76,0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.pins-pkg:active { transform: translateY(0); }
.pins-pkg-amount {
    font-size: 18px; font-weight: 800;
    color: #c9a84c;
    font-family: var(--mono);
}
.pins-pkg-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.pins-pkg-price { font-size: 13px; font-weight: 700; color: var(--text); }
.pins-pkg-badge {
    position: absolute; top: -8px; left: 50%;
    transform: translateX(-50%);
    font-size: 8px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.5px;
    background: #c9a84c; color: #0d0f14;
    padding: 2px 8px; border-radius: 4px;
    box-shadow: 0 2px 6px rgba(201,168,76,0.3);
    white-space: nowrap;
}
.pins-pkg-best { grid-column: 1 / -1; border-color: rgba(201,168,76,0.3); }
.pins-shop-footer {
    text-align: center; font-size: 9px;
    color: var(--text-muted);
    margin-top: 14px; letter-spacing: 0.5px; opacity: 0.7;
}

@media (max-width: 640px) {
    .pins-shop {
        top: auto; bottom: 0; left: 50%;
        transform: translateX(-50%);
        width: 100%; max-width: 100%;
        border-radius: 14px 14px 0 0;
        border-bottom: none;
    }
}

/* ── Pins Celebration / Confetti ── */
.pins-celebration {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    transition: opacity 0.4s ease;
    cursor: pointer;
}
.pins-celeb-content {
    text-align: center;
    animation: celebBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pins-celeb-icon {
    font-size: 56px;
    margin-bottom: 8px;
}
.pins-celeb-title {
    font-size: 28px;
    font-weight: 700;
    color: #c9a84c;
    text-shadow: 0 2px 12px rgba(201,168,76,0.4);
    margin-bottom: 4px;
}
.pins-celeb-amount {
    font-size: 20px;
    font-weight: 600;
    color: #e8e4de;
}
.pins-confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.confetti-particle {
    position: absolute;
    top: -10px;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: confettiFall linear forwards;
}
.confetti-particle:nth-child(odd) {
    width: 6px;
    height: 12px;
    border-radius: 1px;
}
@keyframes celebBounce {
    0% { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
