/* Styles for the transactions views: trades, trade trees, pick lineage, lottery. */

/* ---- trade list cards ---- */
.tx-list { display: flex; flex-direction: column; gap: 12px; }
.tx-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 14px 12px; min-width: 0; }
.tx-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-bottom: 8px; }
.tx-when a { font-weight: 700; }
.tx-score { font-variant-numeric: tabular-nums; color: var(--dim); font-size: 12px; }
.tx-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tx-side { border-top: 3px solid var(--line); padding-top: 6px; min-width: 0; display: flex; flex-direction: column; }
.tx-team { font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tx-assets { list-style: none; margin: 0 0 6px; padding: 0; flex: 1; }
.tx-asset { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.tx-asset:last-child { border-bottom: none; }
.tx-asset-main { min-width: 0; overflow-wrap: anywhere; }
.tx-asset-val { color: var(--dim); font-size: 12px; white-space: nowrap; }
.tx-pick { font-family: var(--mono); font-size: 12px; background: var(--chip); padding: 0 5px; border-radius: 4px; white-space: nowrap; }
.tx-arrow { color: var(--dim); }
.tx-value { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.tx-total { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tx-filter-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); color: var(--text); }

/* ---- ranked lists ---- */
.tx-ranked { list-style: none; margin: 0; padding: 0; }
.tx-rank-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) 90px; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.tx-rank-n { font-size: 20px; font-weight: 700; color: var(--dim); text-align: right; font-variant-numeric: tabular-nums; }
.tx-rank-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.tx-rank-text { margin: 3px 0; }
.tx-rank-stats { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; }
.tx-split { font-weight: 700; font-variant-numeric: tabular-nums; }
.tx-rank-score { text-align: right; font-size: 18px; font-variant-numeric: tabular-nums; }
.tx-scorebar { height: 5px; background: var(--chip); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.tx-scorebar > div { height: 100%; background: var(--accent); border-radius: 3px; }

/* ---- trade web ---- */
.tx-chord-wrap svg { width: 100%; max-width: 620px; height: auto; margin: 0 auto; }
.tx-chord-label { fill: var(--text) !important; font-size: 11px; font-weight: 600; }
.tx-group path { stroke: var(--panel); stroke-width: 1; }
.tx-ribbons path { stroke: var(--panel); stroke-width: .4; transition: fill-opacity .12s; }

/* ---- trade tree page ---- */
.tx-lede { font-size: 15px; margin: -6px 0 12px; }
.tx-summary { margin-bottom: 16px; }
.tx-headline { font-size: 20px; margin-bottom: 10px; line-height: 1.35; }
.tx-tree-controls { margin-bottom: 8px; }
.tx-range input { width: 140px; vertical-align: middle; }
.tx-cut-val, .tx-year-val { min-width: 62px; display: inline-block; color: var(--text); }
.tx-tree-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); margin-bottom: 8px; }
.tx-tree-svg { display: block; }
.tx-tree-svg text { font-size: 12px; }
.tx-axis line { stroke: var(--line); stroke-dasharray: 2 3; }
.tx-axis text { fill: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.tx-future { fill: var(--panel-2); opacity: .7; }
.tx-root { stroke: var(--text); stroke-width: 3; stroke-linecap: round; opacity: .55; }
.tx-side-head { font-size: 11px !important; font-weight: 700; letter-spacing: .06em; }
.tx-link { fill: none; stroke-width: 1.6; opacity: .7; }
.tx-link.merge { stroke-dasharray: 3 3; }
.tx-seg { stroke-linecap: round; opacity: .9; }
.tx-pickline { stroke-width: 2; stroke-dasharray: 4 4; opacity: .85; }
.tx-node { fill: var(--panel); stroke-width: 2.2; }
.tx-node-open { fill: var(--panel); stroke-width: 1.8; }
.tx-hit { fill: transparent; cursor: pointer; }
.tx-hit:hover { fill: var(--accent-soft); }
.tx-glyph { fill: var(--text); font-weight: 700; }
.tx-label { fill: var(--text); paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.tx-row.root .tx-label { font-weight: 700; }
.tx-label-val { fill: var(--dim); font-weight: 400; font-variant-numeric: tabular-nums; }
.tx-tree-svg a:hover .tx-label { text-decoration: underline; }
.tx-hover { fill: transparent; }
.tx-row:hover .tx-hover { fill: var(--hover); }
.tx-trophy { font-size: 11px !important; }
.tx-titles { list-style: none; margin: 0; padding: 0; }
.tx-titles li { padding: 5px 0; border-bottom: 1px solid var(--line); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.tx-trophy-big { font-size: 15px; }

/* story mode */
.tx-story { font-size: 14px; line-height: 1.55; max-width: 860px; }
.tx-story p { margin: 0 0 6px; }
.tx-story-lede { font-size: 15px; }
.tx-story-head { margin: 14px 0 6px; }
.tx-story-side { border-left: 3px solid var(--line); padding-left: 12px; margin-bottom: 8px; }
.tx-story-kids { border-left: 1px dashed var(--line); margin-left: 6px; padding-left: 14px; }
/* Phones: a deep trade tree indented 20px a level left two words a line; indent less, and stop after four levels. */
@media (max-width: 600px) {
	.tx-story-kids { margin-left: 2px; padding-left: 8px; }
	.tx-story-kids .tx-story-kids .tx-story-kids .tx-story-kids { margin-left: 0; padding-left: 3px; }
}
.tx-story-end { margin-top: 12px; font-weight: 600; }

/* trace backward */
.tx-origins { margin: 0; padding-left: 18px; }
.tx-origins li { margin: 4px 0; }
.tx-anc summary { cursor: pointer; color: var(--dim); font-size: 13px; }
.tx-anc[open] > summary { color: var(--text); }

/* ---- picks ---- */
.pk-highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.pk-passports { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.pk-passport { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); position: relative; overflow: hidden; min-width: 0; }
.pk-passport::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--pk-color, var(--accent)); }
.pk-passport.focus { outline: 2px solid var(--accent); }
.pk-title { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.pk-title strong { font-size: 15px; }
.pk-sub { font-size: 12px; color: var(--dim); margin-bottom: 10px; }
.pk-stamps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.pk-stamp {
	display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; padding: 4px 6px;
	border: 2px dashed var(--stamp, var(--dim)); border-radius: 8px; color: var(--stamp-ink, var(--stamp, var(--dim))); transform: rotate(var(--rot, 0deg));
	font-size: 10px; line-height: 1.15; text-align: center; background: var(--panel);
}
.pk-stamp b { font-size: 13px; letter-spacing: .04em; }
.pk-stamp a { color: inherit; }
.pk-stamp.orig { border-style: solid; }
.pk-stamp.used { border-style: double; border-width: 3px; }
.pk-stamp.gap { opacity: .7; }
.pk-sep { color: var(--dim); font-size: 12px; }
.pk-result { border-top: 1px solid var(--line); padding-top: 8px; display: flex; gap: 10px; align-items: center; }
.pk-result .face { border-radius: 6px; }
.pk-result-text { min-width: 0; font-size: 13px; }
.pk-big { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pk-own { color: var(--dim); font-size: 11px; }
table.data td.pk-cell { text-align: center; }
table.data td.pk-got { white-space: normal; min-width: 220px; }
.lt-bars { max-width: 760px; }

/* ---- lottery ---- */
.lt-stage { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 6px 0 12px; perspective: 900px; }
.lt-env { position: relative; height: 96px; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.lt-env.open { transform: rotateY(180deg); }
.lt-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 10px; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px; text-align: center; }
.lt-back { background: linear-gradient(135deg, var(--panel-2), var(--panel)); box-shadow: var(--shadow); }
.lt-back::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 46%; border-bottom: 1px solid var(--line); clip-path: polygon(0 0, 100% 0, 50% 100%); background: var(--chip); }
.lt-back .lt-slot { font-size: 22px; font-weight: 800; color: var(--dim); z-index: 1; margin-top: 30px; }
.lt-front { transform: rotateY(180deg); background: var(--panel); box-shadow: var(--shadow); }
.lt-front .lt-slot { font-size: 13px; font-weight: 800; color: var(--dim); }
.lt-front.jump { box-shadow: 0 0 0 2px var(--good), var(--shadow); }
.lt-front.drop { box-shadow: 0 0 0 2px var(--bad), var(--shadow); }
.lt-move { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lt-up { color: var(--good); }
.lt-down { color: var(--bad); }
.lt-same { color: var(--dim); }
.lt-player { font-size: 11px; color: var(--dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-alt { margin: 0; padding-left: 18px; }
.lt-alt li { margin: 6px 0; }
@media (prefers-reduced-motion: reduce) { .lt-env { transition: none; } }
.lt-bars { display: flex; flex-direction: column; gap: 3px; }
.lt-bar-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 52px; gap: 8px; align-items: center; font-size: 12px; }
.lt-bar-track { position: relative; height: 12px; background: linear-gradient(var(--line), var(--line)) center / 1px 100% no-repeat; }
.lt-bar-fill { position: absolute; top: 1px; bottom: 1px; border-radius: 3px; }
.lt-bar-fill.pos { background: var(--good); }
.lt-bar-fill.neg { background: var(--bad); }
.lt-bar-val { color: var(--dim); }


/* ---- grades (then vs now) ---- */
.tx-side-grades { margin-top: 6px; }
.tx-grades { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tx-grade { display: inline-flex; align-items: baseline; gap: 3px; padding: 0 6px; border-radius: 6px; border: 1px solid currentColor; font-size: 12px; line-height: 18px; white-space: nowrap; color: var(--dim); }
.tx-grade b { font-size: 13px; }
.tx-grade-k { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.tx-grade.then { border-style: dashed; }
.tx-g-A, .tx-g-B { color: var(--good); }
.tx-g-D, .tx-g-F { color: var(--bad); }
.tx-g-A, .tx-g-F { background: var(--chip); }
.tx-grade-arrow { color: var(--dim); font-size: 12px; }
.tx-pos { color: var(--good); }
.tx-neg { color: var(--bad); }
.tx-modes { margin-top: -4px; }
.tx-mode { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; max-width: 100%; min-width: 0; }
.tx-mode .ui-seg { min-width: 0; }
.tx-gl-line { margin: 3px 0; overflow-wrap: anywhere; }
.tx-gl-item { grid-template-columns: 30px minmax(0, 1fr); }
.tx-coef td, .tx-coef th { white-space: nowrap; }
.tx-curve { max-width: 600px; }
.tx-axis-label { fill: var(--dim); font-size: 11px; }
.tx-tn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tx-tn-side { border-top: 3px solid var(--line); padding-top: 6px; min-width: 0; }
.tx-tn-side .tx-team .spacer { flex: 1; }
.tx-tn-table td:first-child { white-space: normal; min-width: 150px; }
.tx-tn-table tfoot th { border-top: 1px solid var(--line); }
.tx-tn-verdict { font-size: 15px; margin: 0 0 10px; }

/* ---- calendar heatmap ---- */
.tx-heat { max-width: 780px; }
.tx-heat-svg text { font-size: 11px; fill: var(--text); }
.tx-heat-head text { fill: var(--dim); font-weight: 600; }
.tx-heat-svg a:hover text { text-decoration: underline; }
.tx-heat-season { fill: var(--dim) !important; font-variant-numeric: tabular-nums; }
.tx-heat-cell { fill: var(--accent); cursor: pointer; }
.tx-heat-cell.empty { fill: var(--chip); fill-opacity: .5; cursor: default; }
.tx-heat-svg a:hover .tx-heat-cell, .tx-heat-svg a:focus .tx-heat-cell { stroke: var(--text); stroke-width: 1.5; }
.tx-heat-n { pointer-events: none; font-variant-numeric: tabular-nums; font-weight: 600; paint-order: stroke; stroke: var(--panel); stroke-width: 2.5px; stroke-linejoin: round; }
.tx-heat-bar { fill: var(--dim); opacity: .45; }
.tx-heat-tot, .tx-heat-coltot { fill: var(--dim) !important; font-variant-numeric: tabular-nums; }
.tx-heat-coltot { font-weight: 700; }

/* ---- pick passport values ---- */
.pk-ev { font-size: 9.5px; font-variant-numeric: tabular-nums; }
.pk-evline { font-size: 12px; color: var(--dim); margin-top: 3px; }
.pk-evline strong { color: var(--text); }

/* ---- responsive ---- */
@media (max-width: 640px) {
	.tx-sides { grid-template-columns: minmax(0, 1fr); }
	.tx-rank-item { grid-template-columns: 24px minmax(0, 1fr); }
	.tx-rank-score { grid-column: 2; text-align: left; display: flex; align-items: center; gap: 8px; }
	.tx-rank-score .tx-scorebar { flex: 1; margin: 0; }
	.tx-headline { font-size: 17px; }
	.tx-range input { width: 110px; }
	.pk-passports { grid-template-columns: minmax(0, 1fr); }
	.lt-stage { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
	.page-trades .picker { min-width: 0; width: 100%; }
	.tx-tn { grid-template-columns: minmax(0, 1fr); }
}

/* ---- search + biggest trade of each season ---- */
.tx-search { margin: 8px 0 4px; }
.tx-search-input { width: 100%; max-width: 420px; box-sizing: border-box; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; }
.tx-tl { list-style: none; margin: 0; padding: 0; }
.tx-tl-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tx-tl-year { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tx-tl-side { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
@media (max-width: 600px) { .tx-tl-item { grid-template-columns: 1fr; gap: 2px; } }

/* ---- lottery simulator ---- */
.lt-sim-sum { margin: 0 0 8px; }
.lt-dist { display: inline-flex; gap: 1px; vertical-align: middle; }
.lt-dist-cell { width: 8px; height: 14px; border-radius: 2px; background: var(--accent); box-sizing: border-box; }
.lt-dist-cell.actual { outline: 2px solid var(--text); outline-offset: -1px; }
@media (max-width: 600px) { .lt-dist-cell { width: 5px; } }
/* Trade page: why these grades */
.tx-why { margin: 6px 0 8px; font-size: 13px; }
.tx-why summary { cursor: pointer; color: var(--dim); font-size: 12px; }
.tx-why-part { margin-top: 4px; }
.tx-why-k { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--dim); }
.tx-why ul { margin: 2px 0 0; padding-left: 18px; }
.tx-why li { margin: 1px 0; line-height: 1.35; }
