/* One-week player×source board. Tokens come from style.css. Prefix: wp- */

.wp-top {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--paper);
  margin: 0 0 16px;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--line);
}

.wp-top .eyebrow {
  margin: 0 0 8px;
}

.wp-nav {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.wp-step {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
}

.wp-step:hover:not(:disabled) {
  background: var(--lime);
  color: var(--green);
}

.wp-step:disabled {
  opacity: 0.35;
}

.wp-nav-mid {
  text-align: center;
  min-width: 0;
}

.wp-kicker {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}

.wp-nav-mid h1 {
  margin: 2px 0 0;
  font-size: 1.75rem;
  letter-spacing: var(--tracking-tight);
}

.wp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.wp-chips button {
  min-width: 36px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.75rem;
}

.wp-chips button[aria-pressed=true] {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}

.wp {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.wp-sources {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wp-src {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-width: 0;
}

.wp-src-name {
  display: block;
  font-size: 0.75rem;
  font-weight: 650;
}

.wp-src-state {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
  color: var(--muted);
}

.wp-src-repeat .wp-src-state {
  color: var(--amber);
}

.wp-src-empty,
.wp-src-unavailable {
  opacity: 0.55;
}

.wp-table {
  min-width: 640px;
}

.wp-table th:first-child,
.wp-table td:first-child,
.wp-table th[scope=row] {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card);
  min-width: 168px;
  text-align: left;
}

.wp-table thead th:first-child {
  background: var(--soft);
  z-index: 2;
}

.wp-table .number {
  white-space: nowrap;
}

.wp-pts {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  gap: 1px;
}

.wp-pts small {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--faint);
}

.wp-pts abbr {
  margin-left: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--faint);
}

.wp-hi {
  color: var(--leaf);
}

.wp-lo {
  color: var(--muted);
  font-weight: 500;
}

.wp-rpt {
  color: var(--muted);
}

.wp-empty,
.wp-bye {
  color: var(--faint);
  font-weight: 600;
}

.wp-bye {
  letter-spacing: var(--tracking-caps);
  font-size: 0.7rem;
}

.wp-bye-row th,
.wp-bye-row td {
  background: var(--soft);
}

.wp-delta {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--amber);
}

.wp-table-wrap {
  margin-bottom: 0;
}

.lu-optimizer,
.lu-all-weeks {
  margin-top: 8px;
}

@media (max-width: 720px) {
  .wp-nav {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    padding: 10px;
  }

  .wp-step {
    width: 44px;
    height: 44px;
  }

  .wp-nav-mid h1 {
    font-size: 1.35rem;
  }

  .wp-sources {
    grid-template-columns: 1fr 1fr;
  }

  .wp-table-wrap {
    background: transparent;
    border: 0;
    overflow: visible;
  }

  .wp-table,
  .wp-table tbody {
    display: block;
    min-width: 0;
  }

  .wp-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .wp-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 8px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
    margin-bottom: 8px;
  }

  .wp-table th[scope=row],
  .wp-table .wp-spread {
    grid-column: 1 / -1;
    position: static;
    background: transparent;
    min-width: 0;
    padding: 0;
    border: 0;
    text-align: left;
  }

  .wp-table .wp-spread .wp-delta::before {
    content: "Spread ";
    font-weight: 500;
    color: var(--muted);
  }

  .wp-table td.wp-src-cell {
    padding: 6px 0 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }

  .wp-table td.wp-src-cell::before {
    content: attr(data-src);
    display: block;
    font-size: 0.65rem;
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 650;
    margin-bottom: 2px;
  }

  .wp-pts,
  .wp-empty,
  .wp-bye {
    align-items: flex-start;
  }

  .wp-bye-row th,
  .wp-bye-row td {
    background: transparent;
  }
}
