/*
 * Tea Court widget — dark, branded theme (matches Onsite! Media: #0a0a0a + red #b90302).
 * Scoped under .tc-case. Headings use the brand font (Cabin) with graceful fallback.
 */
.tc-case {
	--tc-red: #b90302;
	--tc-red-2: #e0392b;
	--tc-green: #18a558;
	--tc-gray: #8b8b96;
	--tc-ink: #ffffff;
	--tc-text: #c8c8d2;
	--tc-muted: #8a8a96;
	--tc-card: #121214;
	--tc-card-2: #0c0c0e;
	--tc-border: #26262d;
	--tc-elev: #1a1a1f;
	--tc-track: #232329;
	--tc-radius: 16px;
	max-width: 860px;
	margin: 2.25rem auto;
	font-family: inherit;
	box-sizing: border-box;
}
.tc-case *,
.tc-case *::before,
.tc-case *::after {
	box-sizing: border-box;
}
/* [hidden] must always win over component display rules (e.g. .tc-loading flex). */
.tc-case [hidden] {
	display: none !important;
}
.tc-case--error {
	padding: 1rem;
	border: 1px dashed var(--tc-red);
	border-radius: 10px;
	color: #ff6b6b;
	font-size: 0.9rem;
}

.tc-card {
	position: relative;
	background: linear-gradient(180deg, var(--tc-card) 0%, var(--tc-card-2) 100%);
	border: 1px solid var(--tc-border);
	border-radius: var(--tc-radius);
	box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.03);
	padding: 1.9rem;
	overflow: hidden;
}
.tc-card::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 4px;
	background: linear-gradient(90deg, var(--tc-red), var(--tc-red-2));
}

/* Header */
.tc-head {
	margin-bottom: 0.9rem;
}
.tc-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.42rem;
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #ff5a4d;
	background: rgba(185, 3, 2, 0.14);
	border: 1px solid rgba(185, 3, 2, 0.28);
	padding: 0.32rem 0.62rem;
	border-radius: 999px;
	line-height: 1;
}
.tc-badge svg {
	width: 0.92rem;
	height: 0.92rem;
	fill: currentColor;
}
.tc-title {
	margin: 0.7rem 0 0;
	font-family: 'Cabin', var(--tc-font, inherit);
	font-size: 1.55rem;
	line-height: 1.2;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--tc-ink);
}
.tc-desc {
	color: var(--tc-text);
	font-size: 1rem;
	line-height: 1.65;
	margin-bottom: 1.4rem;
}
.tc-desc p {
	margin: 0 0 0.6rem;
}
.tc-desc p:last-child {
	margin-bottom: 0;
}

/* Vote prompt + options */
.tc-prompt {
	font-weight: 700;
	color: var(--tc-ink);
	margin: 0 0 0.85rem;
	font-size: 1.02rem;
}
.tc-options {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.65rem;
}
.tc-opt {
	appearance: none;
	cursor: pointer;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--tc-ink);
	background: var(--tc-elev);
	border: 1.5px solid var(--tc-border);
	border-radius: 12px;
	padding: 0.95rem 0.6rem;
	transition: transform 0.14s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
	text-align: center;
	line-height: 1.2;
}
.tc-opt:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 22px -12px rgba(0, 0, 0, 0.9);
}
.tc-opt:focus-visible {
	outline: 2px solid var(--tc-red);
	outline-offset: 2px;
}
.tc-opt.tc--guilty:hover { border-color: var(--tc-red); background: var(--tc-red); color: #fff; }
.tc-opt.tc--notguilty:hover { border-color: var(--tc-green); background: var(--tc-green); color: #fff; }
.tc-opt.tc--neutral:hover { border-color: var(--tc-gray); background: var(--tc-gray); color: #fff; }
.tc-case.is-busy .tc-opt {
	pointer-events: none;
	opacity: 0.5;
}

.tc-error {
	margin: 0.9rem 0 0;
	color: #ff6b6b;
	font-size: 0.88rem;
	font-weight: 600;
}

/* Results */
.tc-results-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 1.1rem;
}
.tc-results-title {
	font-family: 'Cabin', var(--tc-font, inherit);
	font-weight: 800;
	color: var(--tc-ink);
	font-size: 1.1rem;
}
.tc-total {
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--tc-muted);
	white-space: nowrap;
}
.tc-bars {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}
.tc-bar-top {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 0.4rem;
}
.tc-bar-label {
	font-weight: 700;
	color: var(--tc-text);
	font-size: 0.95rem;
}
.tc-bar.is-yours .tc-bar-label { color: var(--tc-ink); }
.tc-bar-pct {
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	color: var(--tc-ink);
	font-size: 0.98rem;
}
.tc-bar-track {
	height: 12px;
	background: var(--tc-track);
	border-radius: 999px;
	overflow: hidden;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}
.tc-bar-fill {
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: var(--tc-gray);
	transition: width 0.95s cubic-bezier(0.22, 1, 0.36, 1);
}
.tc-bar.tc--guilty .tc-bar-fill { background: linear-gradient(90deg, var(--tc-red), var(--tc-red-2)); box-shadow: 0 0 14px -2px rgba(185, 3, 2, 0.6); }
.tc-bar.tc--notguilty .tc-bar-fill { background: linear-gradient(90deg, var(--tc-green), #2ec27a); box-shadow: 0 0 14px -2px rgba(24, 165, 88, 0.55); }
.tc-bar.tc--neutral .tc-bar-fill { background: linear-gradient(90deg, #6f6f7a, var(--tc-gray)); }
.tc-bar.is-yours .tc-bar-label::after {
	content: "\2713 you";
	margin-left: 0.5rem;
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	color: #ff5a4d;
	text-transform: uppercase;
}
.tc-voted-note {
	margin: 1.25rem 0 0;
	padding-top: 1rem;
	border-top: 1px solid var(--tc-border);
	font-size: 0.85rem;
	color: var(--tc-muted);
}
.tc-voted-note strong { color: var(--tc-ink); }

/* Loading */
.tc-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(10, 10, 12, 0.62);
	backdrop-filter: blur(2px);
}
.tc-spinner {
	width: 30px;
	height: 30px;
	border: 3px solid rgba(255, 90, 77, 0.25);
	border-top-color: var(--tc-red);
	border-radius: 50%;
	animation: tc-spin 0.7s linear infinite;
}
@keyframes tc-spin {
	to { transform: rotate(360deg); }
}

/* Reveal animation when results appear */
.tc-results[data-tc-animate] {
	animation: tc-fade 0.45s ease both;
}
@keyframes tc-fade {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

/* Responsive */
@media (max-width: 560px) {
	.tc-card { padding: 1.4rem; }
	.tc-title { font-size: 1.3rem; }
	.tc-options { grid-template-columns: 1fr; }
	.tc-results-head { flex-direction: column; gap: 0.2rem; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	.tc-bar-fill,
	.tc-opt,
	.tc-results[data-tc-animate] { transition: none; animation: none; }
}
