/* ============================================================
   LEADERBOARDS — builder, scored view, export
   ============================================================ */

/* ---------- LIST ---------- */
.lb-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.lb-card{
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px 22px; cursor: pointer;
  transition: border-color .16s, transform .16s;
  position: relative; overflow: hidden;
}
.lb-card:hover{ border-color: var(--line-2); transform: translateY(-2px); }
.lb-card::before{ content:''; position:absolute; top:0; left:0; right:0; height:2px; background: var(--grad); opacity:.6; }
.lb-card-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:14px; }
.lb-card-title{ font-family: var(--display); font-weight:600; font-size:16px; letter-spacing:-0.01em; line-height:1.25; }
.lb-card-sub{ font-size:12px; color: var(--text-3); margin-top:4px; display:flex; align-items:center; gap:8px; }
.lb-type-badge{ font-size:10px; font-weight:700; letter-spacing:0.05em; text-transform:uppercase; padding:3px 8px; border-radius:6px; background: var(--surface-3); color: var(--text-2); }
.lb-type-badge.weekly{ background: rgba(79,159,255,0.13); color: var(--blue-2); }
.lb-type-badge.monthly{ background: rgba(123,77,255,0.15); color: #b9a3ff; }
.lb-card-foot{ display:flex; align-items:center; justify-content:space-between; margin-top:16px; padding-top:14px; border-top:1px solid var(--line); }
.lb-top{ display:flex; align-items:center; gap:8px; font-size:13px; }
.lb-top .crown{ color: var(--warn); display:inline-flex; }
.lb-top .crown svg{ width:15px; height:15px; }
.lb-top b{ color: var(--text); font-weight:600; }
.lb-count{ font-size:12px; color: var(--text-4); }
.lb-pub{ font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:0.05em; padding:3px 8px; border-radius:6px; }
.lb-pub.yes{ background: var(--good-dim); color: var(--good); }
.lb-pub.no{ background: var(--surface-3); color: var(--text-4); }
.lb-card-actions{ position:absolute; top:14px; right:14px; display:flex; gap:4px; opacity:0; transition:opacity .14s; }
.lb-card:hover .lb-card-actions{ opacity:1; }

/* ---------- BUILDER (data entry) ---------- */
.lb-builder-head{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  margin-bottom:18px; flex-wrap:wrap;
}
.lb-back{ display:inline-flex; align-items:center; gap:7px; color: var(--text-3); font-size:13.5px; font-weight:500; transition:color .14s; }
.lb-back:hover{ color: var(--text); }
.lb-back svg{ width:16px; height:16px; }
.lb-period-title{ font-family: var(--display); font-weight:700; font-size:22px; letter-spacing:-0.01em; }
.lb-period-meta{ font-size:12.5px; color: var(--text-3); margin-top:3px; }

.entry-card{
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow:hidden;
}
.entry-scroll{ overflow-x: auto; }
.entry-table{ width:100%; border-collapse:collapse; min-width: 920px; }
.entry-table thead th{
  text-align:left; font-size:10.5px; font-weight:600; letter-spacing:0.05em; text-transform:uppercase;
  color: var(--text-4); padding:13px 10px; border-bottom:1px solid var(--line); white-space:nowrap; position:sticky; top:0;
  background: var(--surface);
}
.entry-table thead th:first-child{ padding-left:20px; }
.entry-table tbody td{ padding:9px 10px; border-bottom:1px solid var(--line); vertical-align:middle; }
.entry-table tbody td:first-child{ padding-left:20px; }
.entry-table tbody tr:last-child td{ border-bottom:none; }
.entry-chatter{ min-width:150px; }
.entry-chatter .ec-name{ font-weight:600; color: var(--text); font-size:13.5px; }
.entry-chatter .ec-models{ display:flex; flex-wrap:wrap; gap:3px; margin-top:4px; }
.entry-chatter .ec-model{ font-size:10px; padding:2px 6px; border-radius:5px; background: var(--surface-3); color: var(--text-3); }
.entry-input{
  width: 74px; background: var(--surface); border:1px solid var(--line-2); border-radius:8px;
  padding:8px 9px; color: var(--text); font-size:13px; font-family: var(--display); text-align:center;
  transition:border-color .14s, box-shadow .14s;
}
.entry-input.wide{ width: 90px; }
.entry-input.narrow{ width: 56px; }
.entry-input:focus{ outline:none; border-color: var(--pink); box-shadow:0 0 0 3px rgba(236,30,121,0.12); }
.entry-input::placeholder{ color: var(--text-4); opacity:0.55; font-style: italic; }
.entry-resp{ display:flex; align-items:center; gap:3px; }
.entry-resp span{ color: var(--text-4); font-size:11px; }
.entry-ghost-note{
  display:flex; align-items:center; gap:9px; padding:12px 20px; font-size:12.5px; color: var(--text-3);
  background: var(--surface); border-top:1px solid var(--line);
}
.entry-ghost-note svg{ width:15px; height:15px; color: var(--blue-2); flex-shrink:0; }
.entry-ghost-note .gv{ color: var(--text-4); font-style:italic; }

.lb-generate-bar{ display:flex; align-items:center; justify-content:space-between; margin-top:18px; gap:16px; flex-wrap:wrap; }
.lb-generate-hint{ font-size:12.5px; color: var(--text-4); }

/* ---------- SCORED VIEW ---------- */
.lb-view-actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

.lb-board{
  border-radius: var(--r-xl); overflow:hidden; border:1px solid var(--line-2);
  background: #08080e;
  position: relative;
}
.lb-board-hero{
  position:relative; padding:26px 30px; overflow:hidden;
  border-bottom:1px solid var(--line);
}
.lb-board-hero-bg{
  position:absolute; inset:0; background: url('/assets/am-hero-strip.jpg') 72% 60%/cover no-repeat; z-index:0;
}
.lb-board-hero-bg::after{ content:''; position:absolute; inset:0;
  background: linear-gradient(90deg, rgba(6,6,12,0.94) 0%, rgba(6,6,12,0.6) 45%, rgba(6,6,12,0.35) 100%); }
.lb-board-hero-inner{ position:relative; z-index:1; display:flex; align-items:center; justify-content:space-between; gap:18px; }
.lb-board-brand{ display:flex; align-items:center; gap:14px; }
.lb-board-brand img{ width:48px; height:48px; border-radius:13px; }
.lb-board-title{ font-family: var(--display); font-weight:700; font-size:23px; letter-spacing:-0.01em; line-height:1.1; }
.lb-board-subtitle{ font-size:11px; font-weight:600; letter-spacing:0.14em; text-transform:uppercase; color: var(--text-3); margin-top:5px; }
.lb-board-daterange{ text-align:right; }
.lb-board-daterange .dr{ font-family: var(--display); font-weight:600; font-size:15px; }
.lb-board-daterange .cc{ font-size:11px; color: var(--text-3); margin-top:3px; text-transform:uppercase; letter-spacing:0.06em; }

.lb-table{ width:100%; border-collapse:collapse; table-layout:fixed; min-width:880px; }
.lb-table th:first-child, .lb-table td:first-child{ width:31%; }
.lb-table th:last-child, .lb-table td:last-child{ width:9%; }
.lb-table thead th{
  text-align:center; font-size:10px; font-weight:600; letter-spacing:0.08em; text-transform:uppercase;
  color: var(--text-4); padding:14px 8px; border-bottom:1px solid var(--line);
}
.lb-table thead th.l{ text-align:left; padding-left:22px; }
.lb-table tbody td{ padding:12px 8px; text-align:center; border-bottom:1px solid rgba(255,255,255,0.04); }
.lb-table tbody td.l{ text-align:left; padding-left:22px; }
.lb-table tbody tr:last-child td{ border-bottom:none; }
.lb-row.top3 td.l{ box-shadow: inset 3px 0 0 0 var(--good); }
.lb-row.bottom3 td.l{ box-shadow: inset 3px 0 0 0 var(--bad); }

.lb-pos{ display:flex; align-items:center; gap:12px; padding-left:6px; }
.lb-pos-rank{ width:60px; display:flex; align-items:center; gap:7px; flex-shrink:0; }
.lb-pos-num{ font-family: var(--display); font-weight:700; font-size:17px; width:22px; text-align:center; }
.lb-pos-num.top{ color: var(--good); }
.lb-pos-num.bottom{ color: var(--bad); }
.lb-chatter-info{ min-width:0; }
.lb-move{ display:inline-flex; align-items:center; font-size:11px; font-weight:700; gap:1px; min-width:24px; }
.lb-move.up{ color: var(--good); } .lb-move.down{ color: var(--bad); } .lb-move.same{ color: var(--text-4); } .lb-move.new{ color: var(--blue-2); }
.lb-move svg{ width:11px; height:11px; }

.lb-chatter-name{ font-family: var(--display); font-weight:700; font-size:15px; color: var(--text); }
.lb-chatter-tag{ font-size:11.5px; color: var(--text-3); font-style:italic; margin-top:3px; }
.lb-chatter-tag.good{ color: var(--good); } .lb-chatter-tag.bad{ color: var(--bad); }
.lb-chatter-models{ display:flex; flex-wrap:wrap; gap:3px; margin-top:5px; }
.lb-chatter-models span{ font-size:10px; padding:2px 6px; border-radius:5px; background: var(--surface-3); color: var(--text-3); }

.lb-cell{
  display:inline-block; min-width:58px; padding:6px 12px; border-radius:9px;
  font-family: var(--display); font-weight:600; font-size:13.5px;
  border:1px solid transparent;
}
.lb-cell.green{ background: rgba(55,217,150,0.10); color: var(--good); border-color: rgba(55,217,150,0.2); }
.lb-cell.yellow{ background: rgba(242,179,56,0.10); color: var(--warn); border-color: rgba(242,179,56,0.2); }
.lb-cell.red{ background: rgba(255,90,106,0.10); color: var(--bad); border-color: rgba(255,90,106,0.2); }
.lb-cell.neutral{ background: var(--surface-2); color: var(--text-2); border-color: var(--line); }
.lb-score{ font-family: var(--display); font-weight:700; font-size:16px; }
.lb-score.green{ color: var(--good); } .lb-score.yellow{ color: var(--warn); } .lb-score.red{ color: var(--bad); }

.lb-legend{ display:flex; align-items:center; gap:20px; padding:16px 24px; border-top:1px solid var(--line); background: rgba(0,0,0,0.2); }
.lb-legend span{ display:flex; align-items:center; gap:7px; font-size:12px; color: var(--text-3); }
.lb-legend .ld{ width:9px; height:9px; border-radius:50%; }

/* PPV insights (not exported) */
.ppv-panel{ margin-top:22px; }
.ppv-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap:14px; }
.ppv-item{ background: linear-gradient(180deg, var(--surface), var(--bg-2)); border:1px solid var(--line); border-radius: var(--r); padding:16px 18px; }
.ppv-item-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.ppv-item-name{ font-family: var(--display); font-weight:700; font-size:14.5px; }
.ppv-item-stats{ font-size:11.5px; color: var(--text-4); }
.ppv-flag{ display:flex; align-items:flex-start; gap:9px; padding:8px 0; border-top:1px solid var(--line); }
.ppv-flag:first-of-type{ border-top:none; }
.ppv-flag-dot{ width:8px; height:8px; border-radius:50%; margin-top:5px; flex-shrink:0; }
.ppv-flag.good .ppv-flag-dot{ background: var(--good); }
.ppv-flag.warn .ppv-flag-dot{ background: var(--warn); }
.ppv-flag.bad .ppv-flag-dot{ background: var(--bad); }
.ppv-flag.info .ppv-flag-dot{ background: var(--text-4); }
.ppv-flag-text .pft{ font-size:13px; font-weight:600; color: var(--text); }
.ppv-flag-text .pfd{ font-size:11.5px; color: var(--text-3); margin-top:2px; line-height:1.5; }

/* Archive groups */
.archive-group{ margin-bottom: 26px; }
.archive-group-head{
  display:flex; align-items:center; gap:10px;
  font-family: var(--display); font-weight:600; font-size:15px; color: var(--text-2);
  margin-bottom: 14px; padding-bottom: 8px; border-bottom:1px solid var(--line);
}
.archive-group-head span{
  font-family: var(--body); font-size:11px; font-weight:600; color: var(--text-4);
  background: var(--surface-3); padding:2px 8px; border-radius:10px;
}

@media (max-width: 900px){
  .lb-board-hero-inner{ flex-direction:column; align-items:flex-start; }
  .lb-board-daterange{ text-align:left; }
}
