/*
 * Top Star Chart — public components.
 * Provisional design system: near-black editorial ink, white surfaces, one "star gold"
 * accent and one electric-blue secondary for live states. Rank numbers dominate.
 * All tokens are CSS custom properties so Elementor / theme CSS can override them.
 */

:root {
	--tsc-ink: #0d0e12;
	--tsc-ink-2: #3a3d46;
	--tsc-muted: #6b6f7a;
	--tsc-line: #e3e3de;
	--tsc-surface: #ffffff;
	--tsc-surface-2: #f5f4ef;
	--tsc-accent: #f2b705;        /* star gold: fills, highlights */
	--tsc-accent-ink: #7a5a00;    /* gold for text on light (AA) */
	--tsc-live: #1f4fff;          /* live / current state */
	--tsc-up: #0a7a3f;
	--tsc-down: #b3261e;
	--tsc-new: #6d28d9;
	--tsc-radius: 10px;
	--tsc-radius-sm: 6px;
	--tsc-gap: clamp(12px, 2vw, 20px);
	--tsc-font: inherit;
	--tsc-font-display: inherit;
	--tsc-focus: 0 0 0 3px rgba(31, 79, 255, .45);
}

.tsc, .tsc * { box-sizing: border-box; }
.tsc { font-family: var(--tsc-font); color: var(--tsc-ink); line-height: 1.45; }
.tsc a { color: inherit; text-decoration: none; }
.tsc a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tsc a:focus-visible, .tsc button:focus-visible, .tsc input:focus-visible, .tsc select:focus-visible, .tsc textarea:focus-visible { outline: none; box-shadow: var(--tsc-focus); border-radius: 4px; }
.tsc .screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.tsc-container { max-width: 1200px; margin: 0 auto; padding: clamp(16px, 4vw, 40px) 16px; }

/* ---------- Shared ---------- */
.tsc-eyebrow { margin: 0 0 4px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tsc-muted); }
.tsc-note { font-size: .9rem; color: var(--tsc-muted); }
.tsc-empty { padding: 24px; background: var(--tsc-surface-2); border-radius: var(--tsc-radius); color: var(--tsc-ink-2); }
.tsc-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.tsc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; border: 2px solid var(--tsc-ink); border-radius: 999px; background: var(--tsc-ink); color: #fff !important; font-weight: 700; font-size: .95rem; line-height: 1; cursor: pointer; text-decoration: none !important; transition: transform .12s ease, background .12s ease; }
.tsc-btn:hover { transform: translateY(-1px); }
.tsc-btn--accent { background: var(--tsc-accent); border-color: var(--tsc-accent); color: var(--tsc-ink) !important; }
.tsc-btn--ghost { background: transparent; color: var(--tsc-ink) !important; border-color: var(--tsc-line); }
.tsc-btn--vote { min-width: 96px; background: var(--tsc-accent); border-color: var(--tsc-accent); color: var(--tsc-ink) !important; }
.tsc-btn--vote.is-voted, .tsc-btn--vote:disabled { background: var(--tsc-surface-2); border-color: var(--tsc-line); color: var(--tsc-muted) !important; cursor: default; transform: none; }
.tsc-btn--vote.is-busy { opacity: .7; }
.tsc-link { font-weight: 600; text-decoration: underline !important; text-underline-offset: 3px; }

.tsc-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; background: var(--tsc-surface-2); font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.tsc-badge--no1 { background: var(--tsc-accent); color: var(--tsc-ink); }
.tsc-badge--demo { background: #ffe7a3; color: #5c4300; }

.tsc-status-pill { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 5px 12px; border-radius: 999px; background: var(--tsc-surface-2); font-size: .8rem; font-weight: 800; letter-spacing: .02em; }
.tsc-status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tsc-muted); }
.tsc-status-pill.is-live::before { background: var(--tsc-live); box-shadow: 0 0 0 4px rgba(31, 79, 255, .18); }
.tsc-status-pill.is-weekly::before { background: var(--tsc-ink); }
.tsc-status-pill.is-provisional::before { background: var(--tsc-accent); }
.tsc-status-pill.is-official { background: var(--tsc-ink); color: #fff; }
.tsc-status-pill.is-official::before { background: var(--tsc-accent); }

.tsc-demo-banner { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--tsc-radius-sm); background: #fff4d1; border: 1px dashed #c99a00; color: #5c4300; font-size: .9rem; }

/* ---------- Artwork ---------- */
.tsc-art { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--tsc-radius-sm); background: var(--tsc-surface-2); }
.tsc-art--placeholder { display: flex; align-items: center; justify-content: center; color: var(--tsc-ink); }
.tsc-art--placeholder svg { width: 100%; height: 100%; }

/* ---------- Chart ---------- */
.tsc-chart__head { display: grid; gap: 8px; margin-bottom: 16px; }
.tsc-chart__title { margin: 0; font-family: var(--tsc-font-display); font-size: clamp(1.8rem, 4.5vw, 3rem); font-weight: 900; letter-spacing: -.02em; line-height: 1; }
.tsc-chart__line { margin: 0; color: var(--tsc-ink-2); max-width: 70ch; }
.tsc-chart__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 20px; }

.tsc-views ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.tsc-views a { display: inline-flex; min-height: 40px; align-items: center; padding: 8px 14px; border: 1px solid var(--tsc-line); border-radius: 999px; font-weight: 700; font-size: .88rem; }
.tsc-views a.is-current { background: var(--tsc-ink); border-color: var(--tsc-ink); color: #fff; }

.tsc-list { margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--tsc-ink); }
.tsc-row {
	display: grid;
	grid-template-columns: 64px 72px minmax(0, 1fr) auto auto;
	grid-template-areas: "rank art main stats share" "rank art main actions actions";
	align-items: center;
	gap: 4px 16px;
	padding: 14px 4px;
	border-bottom: 1px solid var(--tsc-line);
	background: var(--tsc-surface);
}
.tsc-row__rank { grid-area: rank; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.tsc-rank { font-family: var(--tsc-font-display); font-size: 2.2rem; font-weight: 900; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tsc-tie { font-size: .55em; vertical-align: super; color: var(--tsc-muted); margin-right: 1px; }
.tsc-row__art { grid-area: art; }
.tsc-row__main { grid-area: main; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tsc-row__title { font-size: 1.08rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.tsc-row__artist { color: var(--tsc-ink-2); font-weight: 500; overflow-wrap: anywhere; }
.tsc-row__genre { font-size: .78rem; color: var(--tsc-muted); }
.tsc-row__stats { grid-area: stats; display: flex; gap: 16px; margin: 0; }
.tsc-row__stats div { text-align: center; min-width: 40px; }
.tsc-row__stats dt { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tsc-muted); }
.tsc-row__stats dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.tsc-row__actions { grid-area: actions; display: flex; gap: 8px; justify-content: flex-end; }

/* No. 1 and Top 10 treatment */
.tsc-row.is-top1 { grid-template-columns: 80px minmax(120px, 200px) minmax(0, 1fr) auto auto; padding: 20px 4px; background: linear-gradient(90deg, rgba(242, 183, 5, .14), transparent 60%); }
.tsc-row.is-top1 .tsc-rank { font-size: 3.6rem; }
.tsc-row.is-top1 .tsc-row__title { font-size: clamp(1.3rem, 2.6vw, 1.8rem); }
.tsc-row.is-top10 .tsc-rank { font-size: 2.6rem; }

/* Movement */
.tsc-move { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .03em; white-space: nowrap; }
.tsc-move--up { color: var(--tsc-up); }
.tsc-move--down { color: var(--tsc-down); }
.tsc-move--same { color: var(--tsc-muted); }
.tsc-move--new, .tsc-move--reentry { padding: 2px 6px; border-radius: 4px; background: var(--tsc-new); color: #fff; font-size: .62rem; }
.tsc-move--reentry { background: var(--tsc-ink-2); }

/* Share bar (live / vote) */
.tsc-share { grid-area: share; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0 6px; min-width: 150px; }
.tsc-share__label { justify-self: start; }
.tsc-share__pct { font-size: 1.3rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.tsc-share__label { font-size: .75rem; color: var(--tsc-muted); }
.tsc-share__bar { grid-column: 1 / -1; height: 6px; margin-top: 4px; border-radius: 999px; background: var(--tsc-surface-2); overflow: hidden; }
.tsc-share__bar span { display: block; height: 100%; background: var(--tsc-live); border-radius: inherit; transition: width .5s ease; }
.tsc-row.is-top1 .tsc-share__bar span { background: var(--tsc-accent); }

/* Compact (homepage Top 10) */
.tsc-chart.is-compact .tsc-row { grid-template-columns: 48px 56px minmax(0, 1fr); grid-template-areas: "rank art main"; padding: 10px 2px; }
.tsc-chart.is-compact .tsc-row.is-top1 { grid-template-columns: 56px 96px minmax(0, 1fr); }
.tsc-badge { align-self: flex-start; }
.tsc-chart.is-compact .tsc-rank { font-size: 1.7rem; }
.tsc-chart.is-compact .tsc-row.is-top1 .tsc-rank { font-size: 2.4rem; }
.tsc-chart.is-compact .tsc-chart__title { font-size: 1.6rem; }

/* ---------- Hero ---------- */
.tsc-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(20px, 4vw, 48px); align-items: center; padding: clamp(16px, 3vw, 32px); border-radius: calc(var(--tsc-radius) * 1.6); background: var(--tsc-ink); color: #fff; }
.tsc-hero .tsc-demo-banner { grid-column: 1 / -1; margin: 0; }
.tsc-hero .tsc-art { border-radius: var(--tsc-radius); box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.tsc-hero__body { display: grid; gap: 12px; align-content: center; }
.tsc-hero .tsc-status-pill { justify-self: start; background: rgba(255, 255, 255, .12); color: #fff; }
.tsc-hero__label { display: flex; align-items: center; gap: 12px; margin: 0; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--tsc-accent); }
.tsc-hero__rank { font-family: var(--tsc-font-display); font-size: clamp(3.5rem, 9vw, 6.5rem); font-weight: 900; line-height: .8; color: var(--tsc-accent); }
.tsc-hero__title { margin: 0; font-family: var(--tsc-font-display); font-size: clamp(1.8rem, 5vw, 3.4rem); font-weight: 900; line-height: 1.02; letter-spacing: -.02em; overflow-wrap: anywhere; color: #fff; }
.tsc-hero__title a, .tsc-hero__artist a { color: #fff; }
.tsc-hero__artist { margin: 0; font-size: 1.2rem; opacity: .85; }
.tsc-hero__meta { margin: 0; display: flex; gap: 12px; align-items: center; font-size: .9rem; opacity: .9; }
.tsc-hero .tsc-move--up { color: #6ee7a8; }
.tsc-hero .tsc-move--down { color: #ff9b94; }
.tsc-hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.tsc-hero .tsc-btn:not(.tsc-btn--accent) { background: #fff; border-color: #fff; color: var(--tsc-ink) !important; }

/* ---------- Status strip ---------- */
.tsc-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 16px; border-radius: var(--tsc-radius); background: var(--tsc-surface-2); border-left: 6px solid var(--tsc-muted); }
.tsc-strip.is-live { border-left-color: var(--tsc-live); }
.tsc-strip.is-provisional { border-left-color: var(--tsc-accent); }
.tsc-strip.is-official { border-left-color: var(--tsc-ink); }
.tsc-strip ul { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; list-style: none; font-weight: 700; }
.tsc-strip li + li::before { content: "·"; margin: 0 10px; color: var(--tsc-muted); }
.tsc-strip li:first-child { text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Cards (archive, winners, directory, movers) ---------- */
.tsc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--tsc-gap); margin: 0 0 24px; padding: 0; list-style: none; }
.tsc-card { display: flex; flex-direction: column; gap: 4px; }
.tsc-card__link { display: flex; flex-direction: column; gap: 4px; }
.tsc-card__art { display: block; margin-bottom: 6px; }
.tsc-card__eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--tsc-accent-ink); }
.tsc-card__title { font-weight: 800; font-size: 1.05rem; line-height: 1.2; overflow-wrap: anywhere; }
.tsc-card__meta { color: var(--tsc-ink-2); font-size: .92rem; overflow-wrap: anywhere; }
.tsc-card__stat { display: flex; gap: 8px; align-items: center; font-weight: 800; }
.tsc-card__links { font-size: .88rem; }
.tsc-card__links a { text-decoration: underline; }
.tsc-card--main .tsc-card__link { padding: 20px; min-height: 100%; border-radius: var(--tsc-radius); background: var(--tsc-ink); color: #fff; }
.tsc-hub .tsc-card:not(.tsc-card--main) .tsc-card__link { padding: 20px; min-height: 100%; border-radius: var(--tsc-radius); background: var(--tsc-surface-2); }
.tsc-archive__year { margin: 24px 0 12px; font-size: 1.6rem; font-weight: 900; }

/* ---------- Feature ---------- */
.tsc-feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--tsc-gap); align-items: center; padding: var(--tsc-gap); border-radius: var(--tsc-radius); background: var(--tsc-surface-2); }
.tsc-feature h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 900; }

/* ---------- Vote ---------- */
.tsc-vote__head h2 { margin: 0 0 6px; font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 900; }
.tsc-vote__closed { padding: 24px; border-radius: var(--tsc-radius); background: var(--tsc-surface-2); }
.tsc-vote__closed h2 { margin-top: 0; }
.tsc-vote__msg:not(:empty) { position: sticky; top: 8px; z-index: 5; margin: 12px 0; padding: 12px 16px; border-radius: var(--tsc-radius-sm); background: var(--tsc-ink); color: #fff; font-weight: 600; }
.tsc-vote__msg.is-error { background: var(--tsc-down); }
.tsc-row.is-hidden { display: none; }
.tsc-row.is-flash { animation: tsc-flash 1.2s ease; }
@keyframes tsc-flash { 0% { background: rgba(242, 183, 5, .35); } 100% { background: var(--tsc-surface); } }

.tsc-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 16px 0; }
.tsc-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 220px; font-weight: 600; font-size: .9rem; }
.tsc-field input, .tsc-field select, .tsc-field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #c9c9c3; border-radius: var(--tsc-radius-sm); background: #fff; font: inherit; font-weight: 400; color: var(--tsc-ink); }
.tsc-field small { font-weight: 400; color: var(--tsc-muted); }
.tsc-check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; }
.tsc-check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }

/* ---------- Forms ---------- */
.tsc-form { display: grid; gap: 20px; max-width: 760px; }
.tsc-form fieldset { display: grid; gap: 14px; margin: 0; padding: 20px; border: 1px solid var(--tsc-line); border-radius: var(--tsc-radius); }
.tsc-form legend { padding: 0 6px; font-weight: 900; font-size: 1.1rem; }
.tsc-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tsc-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tsc-req { color: var(--tsc-down); }
.tsc-notice { padding: 16px 20px; border-radius: var(--tsc-radius); background: var(--tsc-surface-2); }
.tsc-notice--ok { border-left: 6px solid var(--tsc-up); }
.tsc-notice--error { border-left: 6px solid var(--tsc-down); }
.tsc-notice h2 { margin-top: 0; }

/* ---------- Directory ---------- */
.tsc-az ul { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; padding: 0; list-style: none; }
.tsc-az a { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: var(--tsc-radius-sm); font-weight: 800; }
.tsc-az a:hover, .tsc-az a[aria-current] { background: var(--tsc-ink); color: #fff; text-decoration: none; }
.tsc-pager { display: flex; gap: 10px; }

/* ---------- Profiles ---------- */
.tsc-profile__head { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: clamp(20px, 4vw, 48px); align-items: center; margin-bottom: 32px; }
.tsc-profile__title { margin: 0; font-family: var(--tsc-font-display); font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 900; line-height: 1.02; letter-spacing: -.02em; overflow-wrap: anywhere; }
.tsc-profile__artist { margin: 6px 0; font-size: 1.3rem; font-weight: 600; }
.tsc-profile__meta { margin: 0; color: var(--tsc-muted); }
.tsc-profile__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.tsc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 16px 0 0; }
.tsc-stats div { padding: 12px; border-radius: var(--tsc-radius-sm); background: var(--tsc-surface-2); }
.tsc-stats dt { font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--tsc-muted); }
.tsc-stats dd { margin: 4px 0 0; font-size: 1.5rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.tsc-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.tsc-links a { display: inline-flex; min-height: 40px; align-items: center; padding: 8px 14px; border: 1px solid var(--tsc-line); border-radius: 999px; font-weight: 700; }
.tsc-embed { margin: 0 0 32px; }
.tsc-embed iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--tsc-radius); }
.tsc-profile section { margin-bottom: 32px; }
.tsc-table { width: 100%; border-collapse: collapse; }
.tsc-table th, .tsc-table td { padding: 10px 8px; border-bottom: 1px solid var(--tsc-line); text-align: left; }
.tsc-table a { text-decoration: underline; }

.tsc-sponsored { padding: 10px 14px; border-radius: var(--tsc-radius-sm); background: #fff4d1; border-left: 5px solid var(--tsc-accent); }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
	.tsc-row,
	.tsc-row.is-top1,
	.tsc-list--vote .tsc-row {
		grid-template-columns: 44px 64px minmax(0, 1fr);
		grid-template-areas: "rank art main" "rank stats stats" "rank share share" "rank actions actions";
		gap: 8px 12px;
		padding: 14px 2px;
	}
	.tsc-row.is-top1 { grid-template-columns: 52px 104px minmax(0, 1fr); }
	.tsc-rank, .tsc-row.is-top10 .tsc-rank { font-size: 1.8rem; }
	.tsc-row.is-top1 .tsc-rank { font-size: 2.6rem; }
	.tsc-row__stats { justify-content: flex-start; gap: 12px; }
	.tsc-row__stats div { text-align: left; }
	.tsc-row__actions { justify-content: stretch; }
	.tsc-row__actions .tsc-btn { flex: 1; }
	.tsc-share { min-width: 0; }
	.tsc-chart.is-compact .tsc-row, .tsc-chart.is-compact .tsc-row.is-top1 { grid-template-columns: 40px 52px minmax(0, 1fr); grid-template-areas: "rank art main"; }
	.tsc-hero, .tsc-profile__head, .tsc-feature { grid-template-columns: 1fr; }
	.tsc-grid-2, .tsc-grid-3 { grid-template-columns: 1fr; }
	.tsc-strip { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
	.tsc *, .tsc *::before, .tsc *::after { transition: none !important; animation: none !important; }
}
