/* Taster's Choice — public voting page. Everything is scoped under .tcv so it won't fight your theme. */

.tcv {
	--tcv-accent: #0b4a8b;
	--tcv-highlight: #f2a900;
	--tcv-ink: #1c1a17;
	--tcv-muted: #6b645b;
	--tcv-surface: #ffffff;
	--tcv-canvas: #faf6ee;
	--tcv-line: #e8e0d2;
	--tcv-good: #1f7a4d;
	--tcv-bad: #b3261e;
	--tcv-radius: 18px;
	--tcv-shadow: 0 1px 2px rgba(28, 26, 23, .06), 0 8px 24px rgba(28, 26, 23, .06);

	position: relative;
	color: var(--tcv-ink);
	background: var(--tcv-canvas);
	border-radius: calc(var(--tcv-radius) + 6px);
	overflow: hidden;
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	isolation: isolate;
}
.tcv *, .tcv *::before, .tcv *::after { box-sizing: border-box; }
.tcv [hidden] { display: none !important; }
.tcv h2, .tcv h3, .tcv p { margin: 0; }

/* ---------- Hero ---------- */
.tcv-hero {
	position: relative;
	padding: clamp(28px, 6vw, 56px) clamp(16px, 5vw, 48px) clamp(28px, 5vw, 44px);
	color: #fff;
	background:
		radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--tcv-highlight) 35%, transparent) 0%, transparent 55%),
		linear-gradient(135deg, var(--tcv-accent), color-mix(in srgb, var(--tcv-accent) 70%, #000));
	text-align: center;
}
/* Subtle Bavarian diamond pattern. */
.tcv-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	opacity: .08;
	background-image:
		linear-gradient(60deg, #fff 25%, transparent 25.5%, transparent 75%, #fff 75.5%),
		linear-gradient(-60deg, #fff 25%, transparent 25.5%, transparent 75%, #fff 75.5%);
	background-size: 36px 62px;
	pointer-events: none;
	z-index: -1;
}
.tcv-hero__inner { max-width: 760px; margin: 0 auto; }
.tcv-hero__title {
	font-size: clamp(1.9rem, 5vw, 3rem);
	line-height: 1.1;
	font-weight: 800;
	letter-spacing: -.02em;
	color: #fff;
	margin: 14px 0 10px;
}
.tcv-hero__sub { font-size: clamp(1rem, 2.2vw, 1.125rem); opacity: .9; max-width: 56ch; margin: 0 auto; }

.tcv-status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .16);
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.tcv-status__dot { width: 8px; height: 8px; border-radius: 50%; background: #5ee39b; box-shadow: 0 0 0 4px rgba(94, 227, 155, .25); }
.tcv.is-closed .tcv-status__dot { background: #ff8a80; box-shadow: 0 0 0 4px rgba(255, 138, 128, .25); }

.tcv-counter {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin: 26px auto 0;
	max-width: 560px;
}
.tcv-counter__item {
	padding: 14px 8px;
	border-radius: 14px;
	background: rgba(255, 255, 255, .12);
	backdrop-filter: blur(4px);
}
.tcv-counter__num {
	display: block;
	font-size: clamp(1.5rem, 5vw, 2.25rem);
	font-weight: 800;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	color: var(--tcv-highlight);
}
.tcv-counter__label { display: block; margin-top: 6px; font-size: .8125rem; opacity: .85; }
.tcv-countdown { margin-top: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tcv-live { margin-top: 14px; font-size: .8125rem; opacity: .8; display: inline-flex; align-items: center; gap: 8px; }
.tcv-live__pulse { width: 8px; height: 8px; border-radius: 50%; background: #ff5a5f; animation: tcv-pulse 1.6s infinite; }

/* ---------- Body ---------- */
.tcv-body { padding: clamp(16px, 4vw, 36px); max-width: 1200px; margin: 0 auto; }

.tcv-panel {
	background: var(--tcv-surface);
	border: 1px solid var(--tcv-line);
	border-radius: var(--tcv-radius);
	box-shadow: var(--tcv-shadow);
	padding: clamp(16px, 3vw, 24px);
	margin-bottom: 20px;
	scroll-margin-top: 90px;
}
.tcv-code { border-top: 4px solid var(--tcv-highlight); }
.tcv-code__label { display: block; font-weight: 800; font-size: 1.125rem; margin-bottom: 12px; }
.tcv-code__row { display: flex; gap: 10px; flex-wrap: wrap; }
.tcv-code__input {
	flex: 1 1 180px;
	font-size: 1.375rem !important;
	font-weight: 700;
	letter-spacing: .18em;
	text-transform: uppercase;
	font-variant-numeric: tabular-nums;
}
.tcv-help { margin-top: 10px; color: var(--tcv-muted); font-size: .875rem; }
.tcv-error { margin-top: 10px; color: var(--tcv-bad); font-weight: 600; font-size: .9375rem; }

.tcv-booth__intro { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.tcv-booth__intro .tcv-code__label { margin-bottom: 4px; }
.tcv-booth__intro .tcv-help { margin-top: 0; }
.tcv-booth__icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: color-mix(in srgb, var(--tcv-accent) 10%, #fff); color: var(--tcv-accent); }
.tcv-booth__label { display: block; margin: 0 0 8px; }
.tcv-booth .tcv-code__input { font-size: 1.125rem !important; }

.tcv-me {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding-block: 14px;
}
.tcv-me__text { font-weight: 600; }
.tcv-me__progress { color: var(--tcv-muted); font-weight: 500; }

/* ---------- Inputs & buttons ---------- */
.tcv-input {
	appearance: none;
	width: 100%;
	min-height: 52px;
	padding: 12px 16px;
	font: inherit;
	color: var(--tcv-ink);
	background: #fff;
	border: 2px solid var(--tcv-line);
	border-radius: 12px;
	transition: border-color .15s, box-shadow .15s;
}
.tcv-input:focus { outline: none; border-color: var(--tcv-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tcv-accent) 18%, transparent); }
.tcv-input[aria-invalid="true"] { border-color: var(--tcv-bad); }

.tcv-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 52px;
	padding: 12px 22px;
	border: 0;
	border-radius: 12px;
	font: inherit;
	font-weight: 800;
	font-size: 1rem;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: transform .12s, background-color .15s, color .15s, box-shadow .15s;
	-webkit-tap-highlight-color: transparent;
}
.tcv-btn:active { transform: scale(.97); }
.tcv-btn:focus-visible { outline: 3px solid var(--tcv-highlight); outline-offset: 3px; }
.tcv-btn:disabled { cursor: not-allowed; opacity: .6; }
.tcv-btn--primary { background: var(--tcv-accent); color: #fff; }
.tcv-btn--primary:hover { background: color-mix(in srgb, var(--tcv-accent) 85%, #000); }
.tcv-btn.is-loading { pointer-events: none; }
.tcv-btn.is-loading::after {
	content: "";
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: tcv-spin .7s linear infinite;
}

.tcv-link {
	appearance: none;
	background: none;
	border: 0;
	padding: 6px 0;
	color: var(--tcv-accent);
	font: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.tcv-toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.tcv-search { flex: 1 1 240px; }
.tcv-sort { flex: 0 1 200px; width: auto; background-image: linear-gradient(45deg, transparent 50%, var(--tcv-muted) 50%), linear-gradient(135deg, var(--tcv-muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }

/* ---------- Beer grid ---------- */
.tcv-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
	gap: clamp(14px, 2vw, 22px);
}
.tcv-card {
	position: relative;
	display: flex;
	flex-direction: column;
	margin: 0;
	background: var(--tcv-surface);
	border: 1px solid var(--tcv-line);
	border-radius: var(--tcv-radius);
	box-shadow: var(--tcv-shadow);
	overflow: hidden;
	transition: transform .2s, box-shadow .2s, border-color .2s;
}
.tcv-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(28, 26, 23, .06), 0 14px 32px rgba(28, 26, 23, .1); }
.tcv-card.is-voted { border-color: color-mix(in srgb, var(--tcv-good) 45%, var(--tcv-line)); }
.tcv-card.is-cheers { animation: tcv-cheers .8s ease; }

.tcv-card__media { position: relative; aspect-ratio: 16 / 10; background: #f3ead8; }
.tcv-card__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tcv-card__placeholder {
	display: grid;
	place-items: center;
	height: 100%;
	color: var(--tcv-highlight);
	background:
		radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .7), transparent 60%),
		linear-gradient(160deg, color-mix(in srgb, var(--tcv-highlight) 22%, #fff), color-mix(in srgb, var(--tcv-highlight) 40%, #f3ead8));
}
.tcv-mug { width: 34%; max-width: 96px; height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .12)); }
.tcv-card__num, .tcv-card__leader {
	position: absolute;
	top: 12px;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: .75rem;
	font-weight: 800;
	letter-spacing: .04em;
}
.tcv-card__num { left: 12px; background: rgba(28, 26, 23, .78); color: #fff; }
.tcv-card__leader { right: 12px; background: var(--tcv-highlight); color: #1c1a17; }

.tcv-card__body { padding: 18px 18px 8px; flex: 1; }
.tcv-card__name { font-size: 1.25rem; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; color: var(--tcv-ink); }
.tcv-card__brewery { margin-top: 2px; color: var(--tcv-accent); font-weight: 700; font-size: .9375rem; }
.tcv-card__meta { margin-top: 6px; color: var(--tcv-muted); font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.tcv-card__desc { margin-top: 10px; color: var(--tcv-muted); font-size: .9375rem; }

.tcv-card__foot { padding: 12px 18px 18px; display: grid; gap: 12px; }
.tcv-card__stats { display: grid; gap: 6px; }
.tcv-meter { height: 8px; border-radius: 999px; background: #f1ebdf; overflow: hidden; }
.tcv-meter__bar {
	display: block;
	height: 100%;
	width: 0;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--tcv-highlight), color-mix(in srgb, var(--tcv-highlight) 70%, #b45309));
	transition: width .6s cubic-bezier(.2, .8, .2, 1);
}
.tcv-card__votes { font-size: .875rem; color: var(--tcv-muted); }
.tcv-card__votes strong { color: var(--tcv-ink); font-size: 1.125rem; font-variant-numeric: tabular-nums; display: inline-block; }
.tcv-card__votes strong.is-bump, .tcv-counter__num.is-bump { animation: tcv-bump .5s ease; }

.tcv-vote { width: 100%; background: var(--tcv-accent); color: #fff; }
.tcv-vote:hover { background: color-mix(in srgb, var(--tcv-accent) 85%, #000); }
.tcv-vote.is-confirming { background: var(--tcv-highlight); color: #1c1a17; animation: tcv-nudge .4s ease; }
.tcv-vote.is-locked { background: #f1ebdf; color: var(--tcv-muted); box-shadow: inset 0 0 0 2px var(--tcv-line); }
.tcv-vote.is-locked:hover { background: #ebe3d3; }
.tcv-vote.is-locked::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 10V7a5 5 0 0 0-10 0v3H5v12h14V10zM9 7a3 3 0 0 1 6 0v3H9z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 10V7a5 5 0 0 0-10 0v3H5v12h14V10zM9 7a3 3 0 0 1 6 0v3H9z'/%3E%3C/svg%3E") center / contain no-repeat; }
.tcv-card.is-unlocked { border-color: color-mix(in srgb, var(--tcv-highlight) 60%, var(--tcv-line)); }
.tcv-card.is-spotlight { animation: tcv-spotlight 2.4s ease; }
.tcv-vote.is-voted { background: color-mix(in srgb, var(--tcv-good) 12%, #fff); color: var(--tcv-good); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--tcv-good) 40%, transparent); cursor: default; }
.tcv-vote.is-voted:active { transform: none; }

.tcv-empty { text-align: center; color: var(--tcv-muted); padding: 32px 0; }

/* ---------- Toast ---------- */
.tcv-toast {
	position: fixed;
	left: 50%;
	bottom: max(16px, env(safe-area-inset-bottom));
	z-index: 99999;
	max-width: min(92vw, 460px);
	padding: 14px 20px;
	border-radius: 14px;
	background: #1c1a17;
	color: #fff;
	font-weight: 600;
	box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
	transform: translate(-50%, 140%);
	opacity: 0;
	transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .3s;
	pointer-events: none;
}
.tcv-toast:empty { display: none; }
.tcv-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.tcv-toast--good { background: var(--tcv-good); }
.tcv-toast--bad { background: var(--tcv-bad); }

.tcv-visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

@keyframes tcv-spotlight { 0%, 60% { box-shadow: 0 0 0 4px var(--tcv-highlight), 0 14px 32px rgba(28, 26, 23, .15); } 100% { box-shadow: var(--tcv-shadow); } }
@keyframes tcv-spin { to { transform: rotate(360deg); } }
@keyframes tcv-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes tcv-bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes tcv-nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes tcv-cheers { 0% { transform: scale(1); } 30% { transform: scale(1.03) rotate(-.6deg); } 60% { transform: scale(1.01) rotate(.4deg); } 100% { transform: none; } }

@media (max-width: 480px) {
	.tcv { border-radius: 0; }
	.tcv-counter { gap: 6px; }
	.tcv-counter__label { font-size: .75rem; }
	.tcv-code__row .tcv-btn { flex: 1 1 100%; }
}

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