/* Signal Leaderboard — mọi màu qua biến --lb-*; nền gốc lấy từ biến của theme. */
.tap-lb-page { padding: 120px 24px 80px; max-width: 1200px; margin: 0 auto; }

.tap-lb {
    --lb-bg: transparent;
    --lb-surface: rgba(255,255,255,.04);
    --lb-surface-2: rgba(255,255,255,.08);
    --lb-border: rgba(255,255,255,.12);
    --lb-text: var(--white, #fff);
    --lb-muted: rgba(255,255,255,.66);
    --lb-accent: var(--primary, #4F46E5);
    --lb-accent-text: var(--white, #fff);
    --lb-pos: var(--secondary, #10B981);
    --lb-neg: #F87171;
    --lb-zero: #94A3B8;
    --lb-gold: #F59E0B;
    --lb-silver: #CBD5E1;
    --lb-bronze: #D97706;
    --lb-radius: 14px;
    color: var(--lb-text);
    background: var(--lb-bg);
    border-radius: 20px;
    padding: 4px;
}
.tap-lb[data-lb-theme="light"] {
    --lb-bg: var(--light, #F8FAFC);
    --lb-surface: var(--white, #fff);
    --lb-surface-2: #EEF2F7;
    --lb-border: rgba(15,23,42,.14);
    --lb-text: var(--dark, #0F172A);
    --lb-muted: #475569;
    --lb-pos: #047857;
    --lb-neg: #B91C1C;
    --lb-zero: #475569;
    --lb-gold: #B45309;
    --lb-silver: #64748B;
    --lb-bronze: #92400E;
    padding: 20px;
}
.tap-lb *, .tap-lb *::before, .tap-lb *::after { box-sizing: border-box; }
.tap-lb button, .tap-lb input, .tap-lb select { font: inherit; color: inherit; }

.tap-lb-disclaimer { font-size: 13px; color: var(--lb-muted); margin: 0 0 14px; }
.tap-lb-notice { font-size: 13px; color: var(--lb-muted); padding: 8px 12px; border: 1px dashed var(--lb-border); border-radius: 10px; margin: 0 0 14px; }

/* Thanh trên: tab + nút sáng/tối */
.tap-lb-topbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.tap-lb-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--lb-surface); border: 1px solid var(--lb-border); border-radius: 12px; }
.tap-lb-tab, .tap-lb-seg { min-height: 44px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; color: var(--lb-muted); font-weight: 600; }
.tap-lb-tab[aria-selected="true"], .tap-lb-seg[aria-pressed="true"] { background: var(--lb-accent); color: var(--lb-accent-text); }
.tap-lb-tab:hover:not([aria-selected="true"]), .tap-lb-seg:hover:not([aria-pressed="true"]) { color: var(--lb-text); }
.tap-lb-iconbtn { min-width: 44px; min-height: 44px; border: 1px solid var(--lb-border); border-radius: 12px; background: var(--lb-surface); cursor: pointer; font-weight: 700; }
.tap-lb :focus-visible { outline: 2px solid var(--lb-accent); outline-offset: 2px; }

/* Tiêu đề */
.tap-lb-head { margin-bottom: 14px; }
.tap-lb-head h2 { display: flex; align-items: center; gap: 10px; font-family: 'Space Grotesk', sans-serif; font-size: 28px; line-height: 1.2; margin: 0; }
.tap-lb-head p { margin: 4px 0 0; color: var(--lb-muted); }
.tap-lb-help { width: 28px; height: 28px; min-height: 28px; border-radius: 50%; border: 1px solid var(--lb-border); background: var(--lb-surface); cursor: pointer; font-size: 14px; font-weight: 700; }
.tap-lb-helpbox { margin: 0 0 14px; padding: 12px 14px; background: var(--lb-surface); border: 1px solid var(--lb-border); border-radius: 10px; color: var(--lb-muted); font-size: 14px; }

/* Bộ lọc */
.tap-lb-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.tap-lb-seggroup { display: inline-flex; gap: 2px; padding: 3px; background: var(--lb-surface); border: 1px solid var(--lb-border); border-radius: 10px; }
.tap-lb-input, .tap-lb-select { min-height: 44px; padding: 0 12px; background: var(--lb-surface); border: 1px solid var(--lb-border); border-radius: 10px; color: var(--lb-text); }
.tap-lb-input { flex: 1 1 200px; min-width: 160px; }
.tap-lb-select option { color: #0F172A; background: #fff; }

/* Màu kết quả */
.tap-lb .pos { color: var(--lb-pos); } .tap-lb .neg { color: var(--lb-neg); } .tap-lb .zero { color: var(--lb-zero); }

/* Podium */
.tap-lb-podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: end; margin-bottom: 22px; }
.tap-lb-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; background: var(--lb-surface); border: 1px solid var(--lb-border); border-radius: var(--lb-radius); min-width: 0; }
.tap-lb-card.r1 { order: 2; border-color: var(--lb-gold); box-shadow: 0 0 0 1px var(--lb-gold); padding-block: 26px; }
.tap-lb-card.r2 { order: 1; } .tap-lb-card.r3 { order: 3; }
.tap-lb-medal { position: absolute; top: -14px; left: 16px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--white, #fff); background: var(--lb-silver); }
.r1 .tap-lb-medal { background: var(--lb-gold); } .r3 .tap-lb-medal { background: var(--lb-bronze); }
.tap-lb-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.tap-lb-sym { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 700; }
.tap-lb-big { font-size: 26px; font-weight: 800; line-height: 1.1; }
.tap-lb-sub { font-size: 13px; color: var(--lb-muted); overflow-wrap: anywhere; }
.tap-lb-levels { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; font-variant-numeric: tabular-nums; }
.tap-lb-levels b { color: var(--lb-muted); font-weight: 600; margin-right: 4px; }
.tap-lb-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid currentColor; }
.tap-lb-badge.buy { color: var(--lb-pos); } .tap-lb-badge.sell { color: var(--lb-neg); }
.tap-lb-badge.tp { color: var(--lb-pos); } .tap-lb-badge.sl { color: var(--lb-neg); } .tap-lb-badge.be { color: var(--lb-zero); }
.tap-lb-badge.ver { color: var(--lb-accent); }
.tap-lb-src { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tap-lb-avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--lb-accent); }
.tap-lb-avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.tap-lb-link { color: var(--lb-text); text-decoration: none; }
.tap-lb-link:hover { text-decoration: underline; }
.tap-lb-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-size: 14px; }
.tap-lb-stats span { color: var(--lb-muted); display: block; font-size: 12px; }

/* Bảng */
.tap-lb-tablewrap { overflow-x: auto; background: var(--lb-surface); border: 1px solid var(--lb-border); border-radius: var(--lb-radius); }
.tap-lb-table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tap-lb-table th, .tap-lb-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--lb-border); white-space: nowrap; }
.tap-lb-table th { color: var(--lb-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--lb-surface-2); }
.tap-lb-table tr:last-child td { border-bottom: 0; }
.tap-lb-table td.num, .tap-lb-table th.num { text-align: right; }
.tap-lb-tip { cursor: help; border-bottom: 1px dotted var(--lb-muted); }
.tap-lb-join { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 10px; background: var(--lb-accent); color: var(--lb-accent-text); text-decoration: none; font-weight: 600; }
.tap-lb-join:hover { filter: brightness(1.1); }

/* Phân trang */
.tap-lb-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.tap-lb-pages { display: flex; flex-wrap: wrap; gap: 4px; }
.tap-lb-pg { min-width: 44px; min-height: 44px; padding: 0 10px; border: 1px solid var(--lb-border); border-radius: 10px; background: var(--lb-surface); cursor: pointer; }
.tap-lb-pg[aria-current="page"] { background: var(--lb-accent); color: var(--lb-accent-text); border-color: var(--lb-accent); }
.tap-lb-pg:disabled { opacity: .45; cursor: default; }
.tap-lb-dots { align-self: center; padding: 0 6px; color: var(--lb-muted); }

/* Trạng thái */
.tap-lb-state { text-align: center; padding: 48px 16px; background: var(--lb-surface); border: 1px dashed var(--lb-border); border-radius: var(--lb-radius); }
.tap-lb-state h3 { margin: 0 0 6px; font-size: 18px; }
.tap-lb-state p { margin: 0 0 14px; color: var(--lb-muted); }
.tap-lb-skel { height: 56px; border-radius: 10px; margin-bottom: 10px; background: linear-gradient(90deg, var(--lb-surface) 25%, var(--lb-surface-2) 50%, var(--lb-surface) 75%); background-size: 200% 100%; animation: tap-lb-shimmer 1.4s linear infinite; }
.tap-lb-skel.tall { height: 150px; }
@keyframes tap-lb-shimmer { to { background-position: -200% 0; } }

/* Responsive */
@media (max-width: 820px) {
    .tap-lb-page { padding: 96px 12px 60px; }
    .tap-lb-podium { grid-template-columns: 1fr; gap: 24px; }
    .tap-lb-card.r1 { order: 1; } .tap-lb-card.r2 { order: 2; } .tap-lb-card.r3 { order: 3; }
    .tap-lb-head h2 { font-size: 22px; }
    .tap-lb-tabs { width: 100%; } .tap-lb-tab { flex: 1 1 auto; padding: 0 10px; }
    .tap-lb-pager { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .tap-lb *, .tap-lb *::before, .tap-lb *::after { animation: none !important; transition: none !important; }
}
