/* ── Dynasty Stack & Correlation Matrix ───────────────────────────────── */
/* Classic layout restored; values are $ prices + ticker chips. */

.ds-wrap {
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	/* Prefer shared tokens so page bg matches the rest of the app */
	background: var(--bg-main, #080b11);
	color: #d1d8e0;
	min-height: 100vh;
	padding: 24px;
}

.ds-wrap *, .ds-wrap *::before, .ds-wrap *::after {
	box-sizing: border-box;
}

/* ── Header ─────────────────────────────────────────────────────────── */
.ds-header {
	background: var(--bg-tertiary, #111827);
	border: 1px solid rgba(255,255,255,0.06);
	border-radius: 8px;
	padding: 16px 20px;
	margin-bottom: 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
}
.ds-header-title h1 {
	font-size: 1.45rem;
	font-weight: 800;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin: 0;
	line-height: 1.1;
}
.ds-header-title h1 span {
	color: #00c076;
}
.ds-header-desc {
	font-size: 0.78rem;
	color: #636d7e;
	margin-top: 4px;
	max-width: 42rem;
	line-height: 1.4;
}
.ds-header-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #64748b;
}
.ds-header-meta span {
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(255,255,255,0.06);
	padding: 5px 10px;
	border-radius: 99px;
}

/* ── Filters ────────────────────────────────────────────────────────── */
.ds-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 20px;
	background: var(--bg-tertiary, #111827);
	border: 1px solid rgba(255,255,255,0.06);
	border-radius: 8px;
	padding: 12px 16px;
	margin-bottom: 24px;
}
.ds-filter-group {
	display: flex;
	align-items: center;
	gap: 8px;
}
.ds-filter-lbl {
	font-size: 0.68rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #64748b;
}
.ds-filter-select {
	background: rgba(0,0,0,0.35);
	border: 1px solid rgba(255,255,255,0.1);
	color: #fff;
	font-size: 0.8rem;
	font-weight: 700;
	padding: 6px 10px;
	border-radius: 6px;
	cursor: pointer;
}
.ds-filter-check {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.78rem;
	color: #94a3b8;
	cursor: pointer;
	user-select: none;
}
.ds-filter-check input {
	accent-color: #00c076;
}
.ds-filter-hint {
	font-size: 0.7rem;
	color: #475569;
	margin-left: auto;
}

/* ── Sections ───────────────────────────────────────────────────────── */
.ds-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 28px;
}
.ds-section-title {
	font-size: 0.95rem;
	font-weight: 800;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	gap: 8px;
}
.ds-count {
	font-size: 0.7rem;
	font-weight: 800;
	color: #00c076;
	background: rgba(0,192,118,0.1);
	border: 1px solid rgba(0,192,118,0.25);
	padding: 2px 8px;
	border-radius: 99px;
}
.ds-section-sub {
	font-size: 0.75rem;
	color: #64748b;
	margin: -6px 0 14px;
	line-height: 1.4;
	max-width: 48rem;
}
.ds-empty {
	font-size: 0.75rem;
	color: #64748b;
	font-style: italic;
	padding: 8px 0;
}

/* ── Active Stacks Board ────────────────────────────────────────────── */
.ds-active-section {
	background: var(--bg-tertiary, #111827);
	border: 1px solid rgba(255,255,255,0.06);
	border-radius: 8px;
	padding: 20px;
}
.ds-active-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 14px;
}
.ds-stack-card {
	background: var(--bg-elevated, #1a2236);
	border: 1px solid rgba(255,255,255,0.05);
	border-left: 3.5px solid #00c076;
	border-radius: 6px;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.ds-stack-card.grade-A { border-left-color: #00c076; }
.ds-stack-card.grade-B { border-left-color: #8b5cf6; }
.ds-stack-card.grade-C { border-left-color: #f59e0b; }
.ds-stack-card.grade-D { border-left-color: #475569; }
.ds-stack-card.is-mine {
	box-shadow: inset 0 0 0 1px rgba(0, 192, 118, 0.18);
}
.ds-stack-card[hidden],
.ds-match-card[hidden] {
	display: none !important;
}

.ds-stack-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
}
.ds-stack-owner {
	font-size: 0.72rem;
	color: #636d7e;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}
.ds-stack-owner strong {
	color: #fff;
}
.ds-shape-tag {
	font-size: 0.58rem;
	padding: 1px 5px;
	border-radius: 3px;
	background: rgba(89,167,255,0.12);
	color: #59a7ff;
	font-weight: 800;
	text-transform: uppercase;
}
.ds-mine-badge {
	font-size: 0.58rem;
	font-weight: 800;
	letter-spacing: 0.05em;
	padding: 2px 6px;
	border-radius: 4px;
	background: rgba(0,192,118,0.15);
	color: #00c076;
	border: 1px solid rgba(0,192,118,0.3);
	text-transform: uppercase;
}
.ds-stack-grade {
	font-size: 0.65rem;
	font-weight: 800;
	padding: 2px 7px;
	border-radius: 4px;
	text-transform: uppercase;
	flex-shrink: 0;
}
.ds-stack-grade.grade-A { background: rgba(0,192,118,0.12); color: #00c076; }
.ds-stack-grade.grade-B { background: rgba(139,92,246,0.12); color: #a78bfa; }
.ds-stack-grade.grade-C { background: rgba(245,158,11,0.12); color: #f59e0b; }
.ds-stack-grade.grade-D { background: rgba(100,116,139,0.15); color: #94a3b8; }

.ds-stack-players {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.ds-player-row {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.85rem;
	color: #fff;
	font-weight: 700;
}
.ds-player-pos {
	font-size: 0.58rem;
	font-weight: 800;
	padding: 1px 4px;
	border-radius: 2px;
	text-transform: uppercase;
	flex-shrink: 0;
}
.ds-player-pos.pos-QB { background: rgba(252,43,109,.15); color: #fc2b6d; }
.ds-player-pos.pos-WR { background: rgba(89, 167, 255, 0.15); color: #59a7ff; }
.ds-player-pos.pos-TE { background: rgba(253, 151, 45, 0.15); color: #fd972d; }
.ds-player-pos.pos-RB { background: rgba(32, 206, 184, 0.15); color: #20ceb8; }

.ds-player-main {
	flex: 1;
	min-width: 0;
	font-weight: 700;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 6px;
}
.ds-age {
	font-weight: 500;
	color: #94a3b8;
	font-size: 0.78rem;
}
.ds-inline-ticker {
	font-size: 0.6rem !important;
	vertical-align: middle;
}
.ds-val {
	color: #00c076;
	font-size: 0.7rem;
	font-weight: 800;
	margin-left: 2px;
}
.ds-rb-tgt {
	font-size: 0.6rem;
	font-weight: 700;
	color: #20ceb8;
	background: rgba(32, 206, 184, 0.1);
	padding: 1px 5px;
	border-radius: 3px;
}
.ds-player-team {
	font-size: 0.62rem;
	color: #636d7e;
	text-transform: uppercase;
	flex-shrink: 0;
}
.ds-stack-detail {
	font-size: 0.68rem;
	color: #a3bbd3;
	border-top: 1px solid rgba(255,255,255,0.04);
	padding-top: 6px;
	margin-top: 2px;
}

/* ── Trade Matchmaker Board (classic) ───────────────────────────────── */
.ds-matchmaker-section {
	background: var(--bg-tertiary, #111827);
	border: 1px solid rgba(255,255,255,0.06);
	border-radius: 8px;
	padding: 20px;
}
.ds-matchmaker-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 16px;
}
.ds-match-card {
	background: var(--bg-elevated, #1a2236);
	border: 1px solid rgba(255,255,255,0.05);
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.ds-match-card.is-mine {
	border-color: rgba(0, 192, 118, 0.35);
}
.ds-match-header {
	background: var(--bg-secondary, #0c0f17);
	padding: 10px 14px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ds-match-team-lbl {
	font-size: 0.72rem;
	font-weight: 800;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}
.ds-header-owner {
	font-weight: 600;
	color: #94a3b8;
	text-transform: none;
	letter-spacing: 0;
	font-size: 0.72rem;
}
.ds-match-team-logo {
	width: 18px;
	height: 18px;
	object-fit: contain;
	opacity: 0.85;
}

.ds-match-body {
	padding: 14px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ds-match-split {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.ds-player-block {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.ds-split-owner {
	font-size: 0.65rem;
	color: #636d7e;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 2px;
}
.ds-split-owner span {
	color: #fff;
	font-weight: 700;
	text-transform: none;
	letter-spacing: 0;
}
.ds-split-player {
	background: #0d111a;
	padding: 8px 12px;
	border-radius: 4px;
	border: 1px solid rgba(255,255,255,0.03);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
}
.ds-split-player .name {
	font-size: 0.82rem;
	font-weight: 700;
	color: #fff;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 8px;
	min-width: 0;
	flex: 1;
}
.ds-split-player .meta {
	font-size: 0.62rem;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-weight: 700;
	white-space: nowrap;
	flex-shrink: 0;
	margin-left: auto;
}
.ds-inline-ticker {
	font-size: 0.62rem !important;
	flex-shrink: 0;
}
.ds-val {
	color: #00c076;
	font-size: 0.72rem;
	font-weight: 800;
}
.ds-stack-metrics-line {
	font-size: 0.68rem;
	color: #64748b;
	border-top: 1px solid rgba(255,255,255,0.04);
	padding-top: 8px;
}

/* Trade buttons */
.ds-match-actions {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 2px;
}
.ds-trade-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 10px 12px;
	border-radius: 6px;
	background: #00c076;
	border: none;
	color: #080b11 !important;
	font-size: 0.78rem;
	font-weight: 800;
	text-decoration: none !important;
	text-align: center;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 192, 118, 0.25);
	transition: opacity 0.15s ease, transform 0.15s ease;
}
.ds-trade-btn:hover {
	opacity: 0.92;
	transform: translateY(-1px);
	color: #080b11 !important;
}
.ds-trade-btn-alt {
	background: rgba(89, 167, 255, 0.15);
	color: #59a7ff !important;
	box-shadow: none;
	border: 1px solid rgba(89, 167, 255, 0.35);
}
.ds-trade-btn-alt:hover {
	background: rgba(89, 167, 255, 0.25);
	color: #59a7ff !important;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
	.ds-wrap { padding: 14px; }
	.ds-header { flex-direction: column; align-items: flex-start; gap: 10px; }
	.ds-filters { flex-direction: column; align-items: flex-start; }
	.ds-filter-hint { margin-left: 0; }
	.ds-active-grid, .ds-matchmaker-grid { grid-template-columns: 1fr; }
}
