/* Project Dynasty — P14 transactions ledger + P08 roster growth.
 * Neutral-base surfaces matching the shell tokens; light and dark themes.
 * Scoped under .pd-lg / .pd-growth so no existing surface is affected. */

.pd-lg-room,
.pd-growth {
  --lg-ink: var(--pd-shell-ink, #18181b);
  --lg-dim: var(--pd-shell-dim, #565660);
  --lg-line: var(--pd-shell-line, rgba(24, 24, 27, 0.1));
  --lg-line-strong: var(--pd-shell-line-strong, rgba(24, 24, 27, 0.16));
  --lg-panel: var(--pd-shell-panel, #ffffff);
  --lg-accent: #a87b16;
  --lg-up: #16794a;
  --lg-down: #b3261e;
  color: var(--lg-ink);
}

/* ── P14 hero ─────────────────────────────────────────────── */
.pd-lg-room { display: grid; gap: 18px; }
.pd-lg-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 26px;
  align-items: end;
  overflow: hidden;
  padding: 28px 30px;
  border: 1px solid var(--lg-line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 16%, color-mix(in srgb, var(--team-primary, #6b7280) 22%, transparent), transparent 42%),
    linear-gradient(135deg, #0c1118 0%, #1a2330 62%, #0c1118 100%);
  color: #fff;
  box-shadow: 0 22px 50px rgba(11, 18, 28, 0.18);
}
.pd-lg-hero::after {
  content: "LEDGER";
  position: absolute;
  right: -10px;
  bottom: -30px;
  color: rgba(255, 255, 255, 0.05);
  font-family: var(--display-font, Impact, sans-serif);
  font-size: 120px;
  font-weight: 950;
  letter-spacing: -0.04em;
  pointer-events: none;
}
.pd-lg-kicker {
  display: block;
  margin-bottom: 8px;
  color: #e3c46b;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}
.pd-lg-hero h2 { margin: 0; color: #fff; font-size: clamp(28px, 4vw, 44px); line-height: 1; }
.pd-lg-hero p { max-width: 62ch; margin: 10px 0 0; color: rgba(255, 255, 255, 0.72); font-size: 13px; line-height: 1.55; }
.pd-lg-hero__metrics { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.pd-lg-metric {
  display: grid;
  gap: 2px;
  min-width: 84px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
}
.pd-lg-metric small { color: rgba(255, 255, 255, 0.6); font-size: 9px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }
.pd-lg-metric strong { color: #fff; font-size: 22px; line-height: 1; }
.pd-lg-metric em { color: rgba(255, 255, 255, 0.55); font-size: 10px; font-style: normal; }

/* ── Controls ─────────────────────────────────────────────── */
.pd-lg-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--lg-line);
  border-radius: 16px;
  background: var(--lg-panel);
}
.pd-lg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-lg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--lg-line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--lg-dim);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.pd-lg-chip b { color: var(--lg-ink); font-size: 11px; }
.pd-lg-chip:hover { border-color: var(--lg-accent); color: var(--lg-ink); }
.pd-lg-chip.is-active { border-color: var(--lg-accent); background: color-mix(in srgb, var(--lg-accent) 14%, transparent); color: var(--lg-ink); }
.pd-lg-selects { display: flex; gap: 8px; }
.pd-lg-selects .input,
.pd-lg-selects .select { min-width: 170px; }
.pd-lg-count { color: var(--lg-dim); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }

/* ── Week timeline ────────────────────────────────────────── */
.pd-lg-groups { display: grid; gap: 6px; }
.pd-lg-week { position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; padding: 14px 0 4px; }
.pd-lg-week > header { position: relative; display: flex; gap: 10px; align-items: flex-start; padding-top: 10px; }
.pd-lg-week__node {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  flex: 0 0 auto;
  border: 2px solid var(--lg-accent);
  border-radius: 50%;
  background: var(--lg-panel);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--lg-accent) 14%, transparent);
}
.pd-lg-week > header strong { display: block; font-size: 14px; }
.pd-lg-week > header small { color: var(--lg-dim); font-size: 11px; }
.pd-lg-week::before {
  content: "";
  position: absolute;
  top: 26px;
  bottom: -8px;
  left: 4px;
  width: 1px;
  background: var(--lg-line);
}
.pd-lg-week:last-child::before { display: none; }
.pd-lg-week__body { display: grid; gap: 10px; }

/* ── Ledger entries ───────────────────────────────────────── */
.pd-lg-entry {
  padding: 14px 16px;
  border: 1px solid var(--lg-line);
  border-radius: 16px;
  background: var(--lg-panel);
  box-shadow: 0 10px 28px -22px rgba(9, 9, 11, 0.45);
}
.pd-lg-entry > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pd-lg-entry time { color: var(--lg-dim); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.pd-lg-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lg-accent) 14%, transparent);
  color: var(--lg-ink);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pd-lg-badge.is-trade { background: color-mix(in srgb, #2f6fed 16%, transparent); }
.pd-lg-badge.is-signing,
.pd-lg-badge.is-re_signing { background: color-mix(in srgb, var(--lg-up) 14%, transparent); }
.pd-lg-badge.is-release { background: color-mix(in srgb, var(--lg-down) 12%, transparent); }
.pd-lg-move { display: grid; grid-template-columns: minmax(0, 1.3fr) auto auto; gap: 12px; align-items: center; }
.pd-lg-player { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.pd-lg-player strong { display: block; font-size: 14px; }
.pd-lg-player strong a { color: inherit; text-decoration: none; }
.pd-lg-player strong a:hover { color: var(--lg-accent); }
.pd-lg-player small { display: block; color: var(--lg-dim); font-size: 11px; }
.pd-lg-move__teams { display: inline-flex; align-items: center; gap: 6px; color: var(--lg-dim); font-size: 12px; font-weight: 800; white-space: nowrap; }
.pd-lg-move__contract { color: var(--lg-ink); font-size: 12px; font-weight: 800; white-space: nowrap; }
.pd-lg-trade { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: start; }
.pd-lg-trade h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; }
.pd-lg-trade ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pd-lg-trade li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 7px 10px; border: 1px solid var(--lg-line); border-radius: 10px; }
.pd-lg-trade li strong { font-size: 13px; }
.pd-lg-trade li small { color: var(--lg-dim); font-size: 11px; white-space: nowrap; }
.pd-lg-trade__swap { color: var(--lg-accent); font-size: 18px; font-weight: 950; align-self: center; }
.pd-lg-empty-line { margin: 0; color: var(--lg-dim); font-size: 12px; }
.pd-lg-identity { margin: 0; font-size: 15px; font-weight: 800; }

.pd-lg-detail { margin-top: 10px; border-top: 1px solid var(--lg-line); padding-top: 8px; }
.pd-lg-detail summary { color: var(--lg-dim); font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.pd-lg-detail > div { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; color: var(--lg-dim); font-size: 12px; }
.pd-lg-receipts,
.pd-lg-corrections { display: grid; gap: 4px; margin-top: 8px; }
.pd-lg-receipts small,
.pd-lg-corrections small { color: var(--lg-dim); font-size: 10px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.pd-lg-receipts span,
.pd-lg-receipts a,
.pd-lg-corrections span { color: var(--lg-ink); font-size: 12px; }
.pd-lg-receipts a { text-decoration: underline; }

.pd-lg-empty { padding: 34px 20px; border: 1px dashed var(--lg-line-strong); border-radius: 16px; text-align: center; }
.pd-lg-empty strong { display: block; font-size: 15px; }
.pd-lg-empty p { margin: 6px 0 0; color: var(--lg-dim); font-size: 13px; }

/* ── P08 roster growth ────────────────────────────────────── */
.pd-growth { display: grid; gap: 16px; }
.pd-growth__hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  padding: 24px 26px;
  border: 1px solid var(--lg-line);
  border-radius: 20px;
  background:
    linear-gradient(150deg, color-mix(in srgb, var(--team-primary, #6b7280) 10%, transparent), transparent 60%),
    var(--lg-panel);
}
.pd-growth__hero h2 { margin: 4px 0 0; font-size: clamp(24px, 3vw, 34px); line-height: 1; }
.pd-growth__hero p { max-width: 70ch; margin: 10px 0 0; color: var(--lg-dim); font-size: 13px; line-height: 1.55; }
.pd-growth__metrics { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-growth__metrics .pd-lg-metric {
  border-color: var(--lg-line);
  background: color-mix(in srgb, var(--pd-shell-ink, #18181b) 4%, transparent);
  backdrop-filter: none;
}
.pd-growth__metrics .pd-lg-metric small { color: var(--lg-dim); }
.pd-growth__metrics .pd-lg-metric strong { color: var(--lg-ink); }
.pd-growth__metrics .pd-lg-metric em { color: var(--lg-dim); }
.pd-growth__movers { display: flex; flex-wrap: wrap; gap: 10px; }
.pd-growth__mover {
  display: grid;
  gap: 2px;
  min-width: 180px;
  padding: 12px 14px;
  border: 1px solid var(--lg-line);
  border-radius: 14px;
  background: var(--lg-panel);
}
.pd-growth__mover small { color: var(--lg-dim); font-size: 10px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.pd-growth__mover strong { font-size: 14px; }
.pd-growth__mover b { font-size: 18px; }
.pd-growth__mover em { color: var(--lg-dim); font-size: 11px; font-style: normal; }
.pd-growth__mover.is-up b { color: var(--lg-up); }
.pd-growth__mover.is-down b { color: var(--lg-down); }
.pd-growth__notes { display: grid; gap: 6px; padding: 12px 15px; border: 1px solid var(--lg-line); border-radius: 14px; background: color-mix(in srgb, var(--pd-shell-ink, #18181b) 3%, transparent); }
.pd-growth__notes span { color: var(--lg-dim); font-size: 12px; line-height: 1.5; }
.pd-growth__list { display: grid; gap: 8px; }
.pd-growth__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 18px;
  align-items: center;
  padding: 11px 14px;
  border: 1px solid var(--lg-line);
  border-radius: 14px;
  background: var(--lg-panel);
}
.pd-growth__player { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.pd-growth__player strong { display: block; font-size: 14px; }
.pd-growth__player strong a { color: inherit; text-decoration: none; }
.pd-growth__player strong a:hover { color: var(--lg-accent); }
.pd-growth__player small { display: block; color: var(--lg-dim); font-size: 11px; }
.pd-growth__status { display: block; margin-top: 2px; color: var(--lg-accent); font-size: 11px; font-style: normal; font-weight: 800; }
.pd-growth__status.is-out { color: var(--lg-down); }
.pd-growth__numbers { display: inline-flex; align-items: center; gap: 10px; }
.pd-growth__value { display: grid; justify-items: center; min-width: 54px; }
.pd-growth__value small { color: var(--lg-dim); font-size: 9px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.pd-growth__value b { font-size: 18px; }
.pd-growth__value.is-now b { color: var(--lg-ink); }
.pd-growth__arrow { color: var(--lg-dim); }
.pd-growth__delta { padding: 1px 7px; border-radius: 999px; font-size: 11px; font-style: normal; font-weight: 950; }
.pd-growth__delta.is-up { background: color-mix(in srgb, var(--lg-up) 14%, transparent); color: var(--lg-up); }
.pd-growth__delta.is-down { background: color-mix(in srgb, var(--lg-down) 12%, transparent); color: var(--lg-down); }
.pd-growth__delta.is-flat { background: color-mix(in srgb, var(--pd-shell-ink, #18181b) 6%, transparent); color: var(--lg-dim); }
.pd-growth__bar { grid-column: 1 / -1; height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--pd-shell-ink, #18181b) 7%, transparent); overflow: hidden; }
.pd-growth__bar i { display: block; height: 100%; border-radius: 999px; background: var(--lg-accent); }
.pd-growth__bar.is-up i { background: var(--lg-up); }
.pd-growth__bar.is-down i { background: var(--lg-down); }
.pd-growth__row.arrived .pd-growth__bar i,
.pd-growth__row.departed .pd-growth__bar i { background: var(--lg-dim); }

html[data-theme="dark"] .pd-lg-room,
html[data-theme="dark"] .pd-growth {
  --lg-ink: #f4f4f5;
  --lg-dim: #a7a7b1;
  --lg-line: rgba(255, 255, 255, 0.12);
  --lg-line-strong: rgba(255, 255, 255, 0.2);
  --lg-panel: #27272a;
  --lg-up: #4ade80;
  --lg-down: #f87171;
}
html[data-theme="dark"] .pd-growth__metrics .pd-lg-metric { background: rgba(255, 255, 255, 0.05); }
html[data-theme="dark"] .pd-growth__notes { background: rgba(255, 255, 255, 0.04); }
html[data-theme="dark"] .pd-growth__bar { background: rgba(255, 255, 255, 0.1); }

@media (max-width: 760px) {
  .pd-lg-hero { grid-template-columns: minmax(0, 1fr); padding: 22px 18px; }
  .pd-lg-hero::after { font-size: 76px; }
  .pd-lg-move { grid-template-columns: minmax(0, 1fr); }
  .pd-lg-move__teams,
  .pd-lg-move__contract { white-space: normal; }
  .pd-lg-trade { grid-template-columns: minmax(0, 1fr); }
  .pd-lg-trade__swap { justify-self: center; }
  .pd-lg-week { grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
  .pd-lg-controls { flex-direction: column; align-items: stretch; }
  .pd-lg-selects { flex-direction: column; }
  .pd-lg-selects .input,
  .pd-lg-selects .select { width: 100%; min-width: 0; }
  .pd-growth__hero { grid-template-columns: minmax(0, 1fr); padding: 20px 16px; }
  .pd-growth__metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-growth__metrics .pd-lg-metric { min-width: 0; }
  .pd-growth__row { grid-template-columns: minmax(0, 1fr); }
  .pd-growth__numbers { justify-content: flex-start; }
  .pd-lg-chip { min-height: 40px; }
}
