/* ── Watchlist page ─────────────────────────────────── */

.wl-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0 1.75rem;
  flex-wrap: wrap;
}

.wl-head-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-active {
  opacity: 1 !important;
  font-weight: 600;
}

.wl-loading {
  padding: 4rem 0;
  text-align: center;
  color: var(--muted, #888);
  font-size: 0.95rem;
}

.wl-empty-wrap {
  text-align: center;
  padding: 5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.wl-empty-wrap h2 {
  font-size: 1.4rem;
  margin: 0;
}

/* ── Sections ──────────────────────────────────────── */

.wl-section {
  margin-bottom: 2.5rem;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.wl-section.wl-removing {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.wl-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #888);
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

/* ── Grid ──────────────────────────────────────────── */

.wl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  align-items: start; /* an expanded chart doesn't stretch its row-mates */
}
/* Game cards need more room (match Market Context's 300px min) */
.wl-grid:has(.game-card) {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* ── Cards ─────────────────────────────────────────── */

.wl-card {
  position: relative;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  padding: 1rem 1rem 0.9rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.wl-card.wl-removing {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.wl-card-label {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.2rem;
  padding-right: 1.75rem; /* don't overlap star */
}

.wl-card-sub {
  font-size: 0.72rem;
  color: var(--muted, #888);
  margin-bottom: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wl-card-price {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.wl-no-data {
  font-size: 0.78rem;
  color: var(--muted, #888);
}

/* Change pill */
.change-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 20px;
}
.change-pill.pos { background: rgba(52,211,153,.15); color: #34d399; }
.change-pill.neg { background: rgba(248,113,113,.15); color: #f87171; }
.change-pill.flat { background: rgba(156,163,175,.12); color: #9ca3af; }

/* Per-item stats (day range / mkt cap / volume) */
.wl-stats {
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.wl-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.74rem;
}
.wl-stat span { color: var(--muted, #888); }
.wl-stat b { font-weight: 600; color: var(--text, #eaf0ff); }

/* After-hours / pre-market secondary line (subordinate to the main price) */
.wl-ah {
  font-size: 0.72rem;
  margin-top: 0.3rem;
  color: var(--muted, #888);
}
.wl-ah.pos { color: #6ee7b7; }
.wl-ah.neg { color: #fca5a5; }

/* Click-to-expand chart */
.wl-chartable { cursor: pointer; }
.wl-chart-hint {
  margin-top: 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent2, #9db4ff);
}
.wl-chart-wrap { display: none; margin-top: 0.6rem; }
.wl-card.open .wl-chart-wrap { display: block; }

/* ── Polymarket trader (followed wallet) cards ──────── */
.wl-wallet-wrap { display: none; margin-top: 0.6rem; }
.wl-card.open .wl-wallet-wrap { display: block; max-height: 340px; overflow-y: auto; }
.wl-pos-list { display: flex; flex-direction: column; gap: 0.4rem; }
.wl-pos-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.wl-pos-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}
.wl-pos-side {
  font-size: 0.76rem;
  color: var(--text, #cdd3e0);
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}
.wl-pos-redeem { margin-left: 0.4rem; font-size: 0.68rem; color: #6ee7b7; white-space: nowrap; }
.wl-pos-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; font-size: 0.8rem; }
.wl-pos-stat { display: inline-flex; align-items: center; gap: 0.25rem; }
.wl-pos-stat b { font-weight: 600; }
.wl-pos-stat .lbl {
  color: var(--muted, #888);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── Follow-a-trader form ───────────────────────────── */
.wl-trader-form { margin: 0 0 1.2rem; }
.wl-trader-form > label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #888);
  margin-bottom: 0.4rem;
}
.wl-trader-inputs { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.wl-trader-inputs input {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font-size: 0.85rem;
}
.wl-trader-inputs input#wlTraderNick { flex: 0 1 11rem; }
.wl-trader-msg { margin-top: 0.5rem; font-size: 0.78rem; }
.wl-trader-msg.ok { color: #6ee7b7; }
.wl-trader-msg.err { color: #fca5a5; }

/* ── Sport cards ────────────────────────────────────── */

.wl-sport-card {
  padding-bottom: 1rem;
}

.wl-sport-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-right: 1.75rem;
}

.wl-sport-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #888);
}

.status-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 20px;
  background: rgba(255,255,255,.07);
  color: #ccc;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.status-badge.live { background: rgba(52,211,153,.18); color: #34d399; }
.status-badge.final { background: rgba(156,163,175,.12); color: #9ca3af; }

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.wl-matchup {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.wl-team-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.team-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: #ccc;
  flex-shrink: 0;
  text-align: center;
  line-height: 28px;
}

.wl-team-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wl-score {
  font-size: 1rem;
  font-weight: 700;
  min-width: 1.5rem;
  text-align: right;
  flex-shrink: 0;
}
.wl-score.dim { color: var(--muted, #888); }

.wl-live-detail {
  font-size: 0.73rem;
  color: var(--muted, #888);
  margin-top: 0.25rem;
  text-align: center;
}

/* ── Star button (same as market-context) ──────────── */

.star-btn {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  opacity: .55;
  transition: opacity .15s, transform .15s;
  border-radius: 0 12px 0 12px;
}

.star-btn:hover { opacity: 1; transform: scale(1.15); }
.star-btn::before { content: "☆"; }
.star-btn.starred::before { content: "★"; color: #ffd27a; }
.star-btn.starred { opacity: .9; }

/* ── Mobile ────────────────────────────────────────── */

@media (max-width: 600px) {
  .wl-page-head {
    flex-direction: column;
    align-items: flex-start;
    margin: 1.5rem 0 1.25rem;
  }

  .wl-head-actions {
    width: 100%;
  }

  .wl-head-actions .btn {
    flex: 1;
    justify-content: center;
    text-align: center;
  }

  .wl-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }

  .wl-card {
    padding: 0.85rem 0.85rem 0.8rem;
  }

  .wl-card-price {
    font-size: 1rem;
  }

  /* Sport cards go full width — matchup needs room */
  .wl-sport-card {
    grid-column: 1 / -1;
  }

  .wl-section-title {
    font-size: 0.75rem;
  }

  .star-btn {
    width: 44px;
    height: 44px;
  }
}
