/* Thidasaket — component styles. Colours come from the child theme tokens with fallbacks. */
:root {
	--ts-purple-900: #2a0f3d;
	--ts-purple-800: #3d1659;
	--ts-purple-700: #4f1d73;
	--ts-purple-600: #66288f;
	--ts-magenta: #a3277c;
	--ts-gold: #c9a227;
	--ts-gold-300: #e6cf86;
	--ts-gold-100: #f7eccb;
	--ts-cream: #fbf7ef;
	--ts-ink: #24152e;
	--ts-muted: #5d5066;
	--ts-line: #e7dcea;
	--ts-ok: #1d7a46;
	--ts-warn: #9a5b00;
	--ts-err: #b3261e;
	--ts-radius: 14px;
	--ts-shadow: 0 1px 2px rgb(42 15 61 / 6%), 0 8px 24px rgb(42 15 61 / 8%);
	--ts-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%23c9a227' stroke-opacity='.22' stroke-width='1'%3E%3Cpath d='M24 4 44 24 24 44 4 24Z'/%3E%3Cpath d='M24 14 34 24 24 34 14 24Z'/%3E%3Ccircle cx='24' cy='24' r='2'/%3E%3C/g%3E%3C/svg%3E");
}

.ts-wrap { max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
.ts-wrap--narrow { max-width: 760px; }
.ts-muted { color: var(--ts-muted); font-size: .9em; }
.ts-lead { font-size: 1.05rem; color: var(--ts-muted); }

/* ---------- buttons */
.ts-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5em;
	min-height: 44px; padding: .55em 1.2em; border-radius: 999px; border: 2px solid transparent;
	font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none !important; cursor: pointer;
	transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease;
}
.ts-btn:focus-visible, .ts-card__media:focus-visible, .ts-btn-link:focus-visible { outline: 3px solid var(--ts-gold); outline-offset: 2px; }
.ts-btn:active { transform: translateY(1px); }
.ts-btn[disabled] { opacity: .55; cursor: not-allowed; }
.ts-btn--lg { min-height: 52px; padding: .7em 1.6em; font-size: 1.05rem; }
.ts-btn--small { min-height: 36px; padding: .35em .9em; font-size: .9rem; }
.ts-btn--primary { background: var(--ts-purple-700); color: #fff !important; }
.ts-btn--primary:hover:not([disabled]) { background: var(--ts-purple-600); }
.ts-btn--gold { background: linear-gradient(180deg, #e2c35f, var(--ts-gold)); color: var(--ts-purple-900) !important; box-shadow: 0 4px 14px rgb(201 162 39 / 35%); }
.ts-btn--gold:hover { filter: brightness(1.05); }
.ts-btn--ghost { border-color: rgb(255 255 255 / 70%); color: #fff !important; background: rgb(255 255 255 / 6%); }
.ts-btn--ghost:hover { background: rgb(255 255 255 / 16%); }
.ts-btn--ghost-dark { border-color: var(--ts-purple-700); color: var(--ts-purple-700) !important; background: transparent; }
.ts-btn--ghost-dark:hover { background: var(--ts-gold-100); }
.ts-btn--google { background: #fff; color: #1f1f1f !important; border-color: #dadce0; }
.ts-btn--google:hover { background: #f6f6f8; }
.ts-btn-link { background: none; border: 0; padding: 0; color: var(--ts-purple-700); text-decoration: underline; cursor: pointer; font: inherit; }
.ts-link { color: var(--ts-purple-700); font-weight: 600; text-decoration: none; }
.ts-link:hover { text-decoration: underline; }

/* ---------- hero */
.ts-hero {
	position: relative; color: #fff; text-align: center; isolation: isolate;
	padding: clamp(48px, 9vw, 112px) 0 clamp(56px, 9vw, 104px);
	background:
		linear-gradient(180deg, rgb(42 15 61 / 78%) 0%, rgb(61 22 89 / 86%) 55%, rgb(42 15 61 / 96%) 100%),
		var(--ts-hero-img, none) center 30% / cover no-repeat,
		var(--ts-purple-800);
}
.ts-hero::after {
	content: ""; position: absolute; inset: auto 0 0 0; height: 10px; z-index: -1;
	background: repeating-linear-gradient(90deg, var(--ts-gold) 0 14px, transparent 14px 20px, var(--ts-magenta) 20px 34px, transparent 34px 40px);
	opacity: .9;
}
.ts-hero__inner { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ts-hero__logo { width: clamp(96px, 14vw, 150px); height: auto; filter: drop-shadow(0 6px 18px rgb(0 0 0 / 35%)); }
.ts-hero__logo-wrap { position: relative; width: clamp(96px, 14vw, 150px); }
.ts-hero__logo-wrap .ts-hero__logo { display: block; width: 100%; }
.ts-eyebrow { margin: 0; letter-spacing: .12em; text-transform: uppercase; color: var(--ts-gold-300); font-weight: 600; font-size: .95rem; }
.ts-eyebrow--dark { color: var(--ts-magenta); }
.ts-hero__title { margin: 0; color: #fff !important; font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.15; text-shadow: 0 2px 16px rgb(0 0 0 / 35%); }
.ts-hero__tagline { margin: 0 auto; max-width: 40ch; font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: #f3eaf7; }
.ts-hero__cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }

/* ---------- status */
.ts-status {
	display: grid; gap: 6px; justify-items: start; padding: 16px 18px; margin: 0 0 20px;
	border: 1px solid var(--ts-line); border-radius: var(--ts-radius); background: #fff; box-shadow: var(--ts-shadow);
}
.ts-status--hero { justify-items: center; text-align: center; background: rgb(255 255 255 / 10%); border-color: rgb(255 255 255 / 25%); box-shadow: none; color: #fff; backdrop-filter: blur(4px); margin: 8px 0 4px; }
.ts-status__times { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .95rem; }
.ts-status__tz { color: var(--ts-muted); }
.ts-status--hero .ts-status__tz { color: #e7d9ef; }
.ts-status__countdown { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.ts-status__note { margin: 0; color: var(--ts-warn); }
.ts-badge { display: inline-flex; align-items: center; gap: .45em; padding: .25em .8em; border-radius: 999px; font-weight: 700; font-size: .95rem; background: #eee; color: var(--ts-ink); }
.ts-badge__dot { width: .6em; height: .6em; border-radius: 50%; background: currentColor; }
.ts-status--open .ts-badge { background: #dff3e6; color: var(--ts-ok); }
.ts-status--open .ts-badge__dot { animation: ts-pulse 1.6s ease-in-out infinite; }
.ts-status--upcoming .ts-badge, .ts-status--unscheduled .ts-badge { background: var(--ts-gold-100); color: #6b5410; }
.ts-status--paused .ts-badge { background: #fdecc8; color: var(--ts-warn); }
.ts-status--closed .ts-badge { background: #ece7ef; color: #4a3d52; }
@keyframes ts-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ts-status--open .ts-badge__dot { animation: none; } }

/* ---------- countdown tiles (built by front.js): purple tiles with gold digits; glass + gold on the hero */
.ts-cd { display: grid; justify-items: inherit; gap: 10px; width: 100%; margin: 4px 0 0; }
.ts-cd[hidden] { display: none; }
.ts-cd p.ts-cd__label, .ts-cd p.ts-cd__pcap { margin: 0; } /* beat Astra's .entry-content p margin */
.ts-cd__label { margin: 0; font-weight: 700; font-size: 1rem; color: var(--ts-purple-700); letter-spacing: .02em; }
.ts-cd__tiles { position: relative; display: flex; gap: clamp(6px, 2vw, 14px); }
.ts-cd__unit { display: grid; justify-items: center; gap: 6px; min-width: clamp(64px, 17vw, 92px); animation: ts-cd-pop .6s cubic-bezier(.3, 1.4, .5, 1) both; }
.ts-cd__unit--h { animation-delay: .08s; } .ts-cd__unit--m { animation-delay: .16s; } .ts-cd__unit--s { animation-delay: .24s; }
.ts-cd__face {
	position: relative; overflow: hidden; isolation: isolate;
	display: flex; justify-content: center; width: 100%; padding: .2em .25em;
	border-radius: 14px; border: 1px solid rgb(201 162 39 / 55%);
	background: linear-gradient(180deg, var(--ts-purple-700) 0%, var(--ts-purple-800) 50%, var(--ts-purple-900) 50.5%, var(--ts-purple-800) 100%);
	box-shadow: 0 6px 16px rgb(42 15 61 / 22%), inset 0 1px 0 rgb(255 255 255 / 12%);
	font-size: clamp(1.9rem, 7vw, 2.9rem); font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums;
	color: var(--ts-gold-300);
}
/* flip-clock hinge + slow gold shine sweeping across */
.ts-cd__face::before { content: ""; position: absolute; inset: 50% 0 auto; height: 1px; background: rgb(0 0 0 / 35%); box-shadow: 0 1px 0 rgb(255 255 255 / 8%); z-index: 2; }
.ts-cd__face::after {
	content: ""; position: absolute; inset: -20% auto -20% -60%; width: 40%; z-index: 3; pointer-events: none;
	background: linear-gradient(100deg, transparent, rgb(255 240 200 / 28%), transparent);
	transform: skewX(-18deg); animation: ts-cd-shine 5s ease-in-out infinite;
}
.ts-cd__unit--h .ts-cd__face::after { animation-delay: .25s; } .ts-cd__unit--m .ts-cd__face::after { animation-delay: .5s; } .ts-cd__unit--s .ts-cd__face::after { animation-delay: .75s; }
.ts-cd__digit { position: relative; display: inline-block; width: .62em; height: 1.15em; text-align: center; }
.ts-cd__new, .ts-cd__old {
	position: absolute; inset: 0;
	background: linear-gradient(180deg, #fff6d6 0%, #f0d77f 45%, #c9a227 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ts-cd__digit.is-roll .ts-cd__new { animation: ts-cd-in .5s cubic-bezier(.2, .9, .3, 1.2) both; }
.ts-cd__digit.is-roll .ts-cd__old { animation: ts-cd-out .5s ease-in both; }
.ts-cd__cap { font-size: .85rem; font-weight: 600; color: var(--ts-muted); }
/* seconds tile breathes a soft gold glow */
.ts-cd__unit--s .ts-cd__face { animation: ts-cd-glow 1s ease-in-out infinite; }

/* progress through the voting window */
.ts-cd__progress { display: grid; gap: 4px; width: min(100%, 420px); justify-items: inherit; }
.ts-cd__progress[hidden] { display: none; }
.ts-cd__track { position: relative; width: 100%; height: 8px; border-radius: 999px; background: var(--ts-line); overflow: hidden; }
.ts-cd__fill {
	position: absolute; inset: 0 auto 0 0; border-radius: inherit; transition: width 1s linear;
	background: linear-gradient(90deg, var(--ts-magenta), var(--ts-gold) 70%, #f3dc8e);
	background-size: 200% 100%; animation: ts-cd-flow 3s linear infinite;
}
.ts-cd__fill::after { content: ""; position: absolute; right: -2px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: #fff7d9; box-shadow: 0 0 10px 3px rgb(240 215 127 / 80%); }
.ts-cd__pcap { margin: 0; font-size: .82rem; color: var(--ts-muted); }

/* hero (dark background): glass tiles, white captions, gold sparkles at the corners */
.ts-status--hero { padding: 18px clamp(14px, 4vw, 32px) 20px; }
.ts-status--hero .ts-cd__label { color: #fff; font-size: 1.05rem; }
.ts-status--hero .ts-cd__face {
	background: linear-gradient(180deg, rgb(255 255 255 / 16%) 0%, rgb(255 255 255 / 7%) 50%, rgb(0 0 0 / 14%) 50.5%, rgb(255 255 255 / 6%) 100%);
	border-color: rgb(230 207 134 / 65%); box-shadow: 0 8px 24px rgb(0 0 0 / 28%), inset 0 1px 0 rgb(255 255 255 / 22%);
	backdrop-filter: blur(6px);
}
.ts-status--hero .ts-cd__cap { color: #f3eaf7; }
.ts-status--hero .ts-cd__track { background: rgb(255 255 255 / 18%); }
.ts-status--hero .ts-cd__pcap { color: #e7d9ef; }
.ts-status--hero .ts-cd__tiles::before, .ts-status--hero .ts-cd__tiles::after {
	content: "✦"; position: absolute; color: var(--ts-gold-300); text-shadow: 0 0 8px rgb(240 215 127 / 90%); pointer-events: none;
	animation: ts-cd-twinkle 2.4s ease-in-out infinite;
}
.ts-status--hero .ts-cd__tiles::before { top: -12px; left: -10px; font-size: 18px; }
.ts-status--hero .ts-cd__tiles::after { bottom: 14px; right: -12px; font-size: 13px; animation-delay: 1.2s; }

/* opening soon: gold tiles; last hour before closing: magenta tiles that pulse */
.ts-cd.is-upcoming .ts-cd__face { border-color: var(--ts-gold); }
.ts-cd.is-urgent .ts-cd__label { color: var(--ts-magenta); }
.ts-status--hero .ts-cd.is-urgent .ts-cd__label { color: #ffd1ec; }
.ts-cd.is-urgent .ts-cd__face { border-color: #e04aa8; animation: ts-cd-urgent 1s ease-in-out infinite; }

@keyframes ts-cd-pop { from { opacity: 0; transform: translateY(10px) scale(.9); } }
@keyframes ts-cd-in { from { transform: translateY(-75%); opacity: 0; } }
@keyframes ts-cd-out { to { transform: translateY(75%); opacity: 0; } }
@keyframes ts-cd-shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@keyframes ts-cd-glow { 50% { box-shadow: 0 6px 16px rgb(42 15 61 / 22%), 0 0 0 1px rgb(240 215 127 / 35%), 0 0 18px rgb(240 215 127 / 35%), inset 0 1px 0 rgb(255 255 255 / 12%); } }
@keyframes ts-cd-urgent { 50% { box-shadow: 0 0 0 2px rgb(224 74 168 / 45%), 0 0 22px rgb(224 74 168 / 55%); } }
@keyframes ts-cd-flow { to { background-position: -200% 0; } }
@keyframes ts-cd-twinkle { 0%, 100% { opacity: .25; transform: scale(.7) rotate(0); } 50% { opacity: 1; transform: scale(1.15) rotate(25deg); } }
@media (max-width: 380px) {
	.ts-cd__unit { min-width: 0; flex: 1 1 0; }
	.ts-cd__tiles { width: 100%; }
	.ts-cd__cap { font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) {
	.ts-cd__unit, .ts-cd__face, .ts-cd__face::after, .ts-cd__fill, .ts-cd__tiles::before, .ts-cd__tiles::after { animation: none !important; }
	.ts-cd__face::after { display: none; }
	.ts-cd__fill { transition: none; }
}

/* ---------- sections */
.ts-section { padding: clamp(40px, 6vw, 72px) 0; }
.ts-section--alt,
body.ts-page-announcements, body.ts-page-announcements #content { background: var(--ts-cream) var(--ts-pattern); }
.ts-section--lilac, .ts-session-bar,
body.ts-page-contestants, body.ts-page-contestants #content {
	background: #f6f0fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%23a3277c' stroke-opacity='.13' stroke-width='1'%3E%3Cpath d='M24 4 44 24 24 44 4 24Z'/%3E%3Cpath d='M24 14 34 24 24 34 14 24Z'/%3E%3Ccircle cx='24' cy='24' r='2'/%3E%3C/g%3E%3C/svg%3E");
}
.ts-section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 24px; }
.ts-section__title { margin: 0; color: var(--ts-purple-800); font-size: clamp(1.5rem, 3.4vw, 2.1rem); position: relative; padding-bottom: 10px; }
.ts-section__title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 56px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--ts-gold), var(--ts-magenta)); }
.ts-section--rose { background: #fcf0f5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%23a3277c' stroke-opacity='.12' stroke-width='1'%3E%3Cpath d='M24 4 44 24 24 44 4 24Z'/%3E%3Cpath d='M24 14 34 24 24 34 14 24Z'/%3E%3Ccircle cx='24' cy='24' r='2'/%3E%3C/g%3E%3C/svg%3E"); }
.ts-section--peach,
body.ts-page-contact, body.ts-page-contact #content { background: #fdf3ea url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%23c9a227' stroke-opacity='.24' stroke-width='1'%3E%3Cpath d='M24 4 44 24 24 44 4 24Z'/%3E%3Cpath d='M24 14 34 24 24 34 14 24Z'/%3E%3Ccircle cx='24' cy='24' r='2'/%3E%3C/g%3E%3C/svg%3E"); }
.ts-intro { padding-block: 36px; text-align: center; font-size: 1.12rem; color: var(--ts-muted); }
.ts-intro p { margin: 0; }

/* ---------- grid + cards: 3 / 2 / 1 columns */
.ts-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .ts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .ts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; } }

.ts-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--ts-line); border-radius: var(--ts-radius); overflow: hidden; box-shadow: var(--ts-shadow); transition: box-shadow .2s ease, border-color .2s ease; }
.ts-card.is-mine { border-color: var(--ts-gold); box-shadow: 0 0 0 3px var(--ts-gold-300), var(--ts-shadow); }
.ts-card__media { position: relative; display: block; width: 100%; padding: 0; border: 0; background: var(--ts-gold-100); cursor: zoom-in; aspect-ratio: 2 / 3; overflow: hidden; }
.ts-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.ts-card__media:hover img { transform: scale(1.03); }
.ts-card__media[disabled] { cursor: default; }
.ts-card__noimg { display: grid; place-items: center; height: 100%; color: var(--ts-muted); }
.ts-card__no { position: absolute; top: 12px; left: 12px; min-width: 52px; padding: 6px 10px; border-radius: 10px; background: var(--ts-purple-800); color: var(--ts-gold-300); font-weight: 800; font-size: 1.35rem; line-height: 1; box-shadow: 0 2px 8px rgb(0 0 0 / 25%); }
.ts-card__count { position: absolute; right: 10px; bottom: 10px; padding: 3px 8px; border-radius: 999px; background: rgb(0 0 0 / 55%); color: #fff; font-size: .8rem; }
.ts-card__body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; flex: 1; }
.ts-card__eyebrow { margin: 0; color: var(--ts-magenta); font-weight: 700; font-size: .9rem; }
.ts-card__name { margin: 0; font-size: 1.2rem; color: var(--ts-ink); }
.ts-card__desc { margin: 0; color: var(--ts-muted); font-size: .95rem; }
.ts-card__actions { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.ts-card__mine { margin: 4px 0 0; color: #6b5410; font-weight: 700; }
.ts-card.is-mine .ts-vote-btn { background: var(--ts-gold); color: var(--ts-purple-900) !important; }

.ts-empty { padding: 32px; text-align: center; border: 2px dashed var(--ts-line); border-radius: var(--ts-radius); color: var(--ts-muted); background: #fff; }

/* ---------- vote app */
.ts-session-bar { padding: 12px 0; border-bottom: 1px solid var(--ts-line); }
.ts-session-bar__account { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: fit-content; max-width: 100%; margin-left: auto; padding: 12px 14px; background: #fffdf8; border: 1px solid var(--ts-line); border-radius: 16px; box-shadow: 0 3px 12px rgb(42 15 61 / 5%); }
.ts-session-bar[hidden], .ts-session-bar__account[hidden] { display: none; }
.ts-session-bar__account p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ts-session-bar__avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ts-purple-800); color: var(--ts-gold-300); box-shadow: inset 0 0 0 1px rgb(201 162 39 / 35%); }
.ts-session-bar__avatar svg { width: 24px; height: 24px; }
.ts-session-bar__details { min-width: 0; max-width: 460px; line-height: 1.5; }
.ts-session-bar__who { font-size: .9rem; color: var(--ts-purple-900); }
.ts-session-bar__label { margin-right: 4px; color: var(--ts-muted); font-size: .78rem; }
.ts-session-bar__details .ts-account__email { display: block; font-size: .75rem; overflow-wrap: anywhere; word-break: normal; }
.ts-session-bar__account .ts-session-bar__logout { min-height: 44px; margin-left: 4px; padding-inline: 16px; border-width: 1px; border-color: var(--ts-line); background: #fff; color: var(--ts-purple-700) !important; white-space: nowrap; }
.ts-session-bar__account .ts-session-bar__logout:hover:not([disabled]) { background: var(--ts-purple-800); color: #fff !important; border-color: var(--ts-purple-800); }
.ts-session-bar .ts-alert { margin: 0; }
@media (max-width: 540px) {
	.ts-session-bar { padding: 10px 0; }
	.ts-session-bar__account { grid-template-columns: 32px minmax(0, 1fr); gap: 8px 10px; padding: 12px; width: 100%; }
	.ts-session-bar__avatar { width: 32px; height: 32px; align-self: start; margin-top: 2px; }
	.ts-session-bar__avatar svg { width: 20px; height: 20px; }
	.ts-session-bar__account .ts-session-bar__logout { grid-column: 2; justify-self: end; margin-left: 0; }
}
.ts-account { padding: 16px 18px; margin-bottom: 16px; border-radius: var(--ts-radius); background: var(--ts-cream); border: 1px solid var(--ts-line); }
.ts-account p { margin: 0 0 10px; }
.ts-account p:last-child { margin-bottom: 0; }
.ts-account__email { color: var(--ts-muted); word-break: break-all; }
.ts-account__choice { font-size: 1.05rem; }
.ts-account__choice strong { color: var(--ts-purple-700); }
.ts-account__warn { color: var(--ts-err); }
.ts-alert { padding: 12px 16px; margin-bottom: 16px; border-radius: 10px; border-left: 5px solid var(--ts-err); background: #fdeceb; color: #5f1410; }
.ts-alert.is-ok { border-color: var(--ts-ok); background: #e5f5ec; color: #0f3f24; }
.ts-alert.is-info { border-color: var(--ts-purple-600); background: #f3ebf8; color: var(--ts-purple-900); }
.ts-rules { margin-bottom: 24px; border: 1px solid var(--ts-line); border-radius: var(--ts-radius); background: #fff; }
.ts-rules summary { padding: 14px 18px; cursor: pointer; font-weight: 700; color: var(--ts-purple-800); }
.ts-rules__body { padding: 0 18px 12px; }
.ts-vote-app.is-busy .ts-vote-btn { pointer-events: none; }

/* ---------- dialogs */
.ts-dialog { border: 0; padding: 0; border-radius: 18px; width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-shadow: 0 24px 64px rgb(0 0 0 / 30%); color: var(--ts-ink); }
.ts-dialog--wide { width: min(760px, calc(100vw - 32px)); }
.ts-dialog::backdrop { background: rgb(30 10 45 / 60%); }
.ts-dialog__box { padding: 24px; }
.ts-dialog__title { margin: 0 0 12px; font-size: 1.35rem; color: var(--ts-purple-800); }
.ts-dialog__body p { margin: 0 0 10px; }
.ts-dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.ts-move { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; border-radius: 10px; background: var(--ts-cream); }
.ts-move b { color: var(--ts-purple-700); }

/* ---------- lightbox */
.ts-lightbox { border: 0; padding: 0; width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; background: rgb(15 5 22 / 94%); color: #fff; }
.ts-lightbox::backdrop { background: rgb(15 5 22 / 94%); }
.ts-lightbox__stage { position: absolute; inset: 56px 56px 64px; display: grid; place-items: center; }
.ts-lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.ts-lightbox__loading { position: absolute; margin: 0; }
.ts-lightbox__caption { position: absolute; left: 0; right: 0; bottom: 16px; margin: 0; text-align: center; font-weight: 600; }
.ts-lightbox__btn, .ts-lightbox__close { position: absolute; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgb(255 255 255 / 14%); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }
.ts-lightbox__btn:hover, .ts-lightbox__close:hover { background: rgb(255 255 255 / 26%); }
.ts-lightbox__prev { left: 8px; top: 50%; translate: 0 -50%; }
.ts-lightbox__next { right: 8px; top: 50%; translate: 0 -50%; }
.ts-lightbox__close { top: 8px; right: 8px; }
/* Astra gives buttons padding 19px 32px, which stretched the circle and pushed the glyph off-center: reset it and draw the × in CSS so it sits exactly in the middle. */
.ts-lightbox__btn, .ts-lightbox__close { box-sizing: border-box; display: grid; place-items: center; padding: 0; min-width: 0; min-height: 0; margin: 0; }
.ts-lightbox__btn[hidden], .ts-lightbox__close[hidden] { display: none; }
.ts-lightbox__close { font-size: 0; }
.ts-lightbox__close::before, .ts-lightbox__close::after { content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 2.5px; border-radius: 2px; background: currentColor; rotate: 45deg; }
.ts-lightbox__close::after { rotate: -45deg; }
@media (max-width: 639px) { .ts-lightbox__stage { inset: 56px 8px 56px; } .ts-lightbox__btn { top: auto; bottom: 6px; translate: none; } }

/* ---------- announcements */
.ts-news { display: grid; gap: 20px; }
.ts-news__item { display: grid; gap: 16px; padding: 18px; background: #fff; border: 1px solid var(--ts-line); border-radius: var(--ts-radius); box-shadow: var(--ts-shadow); }
@media (min-width: 720px) { .ts-news__item:has(.ts-news__media) { grid-template-columns: 240px 1fr; } }
.ts-news__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; display: block; }
.ts-news__date { display: block; margin: 0 0 4px; color: var(--ts-magenta); font-weight: 600; font-size: .9rem; }
.ts-news__title { margin: 0 0 6px; font-size: 1.2rem; }
.ts-news__title a { color: var(--ts-ink); text-decoration: none; }
.ts-news__title a:hover { color: var(--ts-purple-700); }
.ts-news__excerpt { margin: 0 0 12px; color: var(--ts-muted); }
.ts-pager { margin-top: 24px; display: flex; gap: 8px; flex-wrap: wrap; }
.ts-pager .page-numbers { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--ts-line); text-decoration: none; }
.ts-pager .current { background: var(--ts-purple-700); color: #fff; border-color: var(--ts-purple-700); }

/* ---------- results */
.ts-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--ts-radius); overflow: hidden; box-shadow: var(--ts-shadow); }
.ts-table caption { text-align: left; padding: 0 0 10px; font-weight: 600; color: var(--ts-purple-800); }
.ts-table th, .ts-table td { padding: 12px 14px; border-bottom: 1px solid var(--ts-line); text-align: left; vertical-align: middle; }
.ts-table th { background: var(--ts-purple-800); color: #fff; font-weight: 600; }
.ts-num { text-align: right !important; font-variant-numeric: tabular-nums; font-weight: 700; }
.ts-bar { display: block; height: 6px; margin-top: 6px; width: var(--w); min-width: 2px; border-radius: 6px; background: linear-gradient(90deg, var(--ts-gold), var(--ts-magenta)); }
/* results table on tablet/mobile (2026-11-19): narrow number/score columns so names get the width; PC unchanged */
@media (max-width: 1024px) {
	.ts-results .ts-table { table-layout: fixed; }
	.ts-results .ts-table th:first-child, .ts-results .ts-table td:first-child { width: 76px; text-align: center; }
	.ts-results .ts-table th:last-child { width: 88px; }
	.ts-results .ts-table th { white-space: nowrap; }
	.ts-results .ts-table th:first-child { padding-inline: 4px; font-size: .88rem; }
	.ts-results .ts-no { display: inline-grid; place-items: center; min-width: 2.3em; height: 2.3em; padding: 0 4px; border-radius: 999px; background: #f3ecf8; color: var(--ts-purple-800); font-weight: 700; font-variant-numeric: tabular-nums; }
	.ts-results .ts-name { display: block; font-weight: 500; line-height: 1.4; }
}
@media (max-width: 600px) {
	.ts-results .ts-table caption { font-size: .95rem; line-height: 1.45; }
	.ts-results .ts-table th, .ts-results .ts-table td { padding: 10px 8px; }
	.ts-results .ts-table th { font-size: .85rem; }
	.ts-results .ts-table th:first-child, .ts-results .ts-table td:first-child { width: 62px; padding-inline: 4px; }
	.ts-results .ts-table th:first-child { font-size: .8rem; }
	.ts-results .ts-table th:last-child { width: 64px; }
	.ts-results .ts-table td { font-size: .95rem; }
	.ts-results .ts-num { font-size: 1.02rem; }
	.ts-results .ts-no { font-size: .9rem; }
	.ts-results .ts-bar { height: 5px; margin-top: 5px; }
	.ts-results > .ts-muted { font-size: .85rem; }
}
.ts-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--ts-gold-100); color: #6b5410; font-size: .8rem; font-weight: 700; }

/* ---------- timeline / contact */
.ts-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ts-timeline li { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 16px; padding: 14px 18px; background: #fff; border-radius: 12px; border-left: 5px solid var(--ts-gold); box-shadow: var(--ts-shadow); }
.ts-timeline__date { font-weight: 700; color: var(--ts-purple-700); }
@media (max-width: 539px) { .ts-timeline li { grid-template-columns: 1fr; gap: 2px; } }
.ts-contact { display: grid; gap: 24px; }
@media (min-width: 900px) { .ts-contact:has(.ts-contact__form), .ts-contact:has(.ts-contact__map) { grid-template-columns: 1fr 1.2fr; } }
.ts-contact__list { margin: 0; display: grid; gap: 12px; align-content: start; }
.ts-contact__list div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 16px; background: #fff; border-radius: 12px; border: 1px solid var(--ts-line); }
.ts-contact__list dt { font-weight: 700; color: var(--ts-purple-700); }
.ts-contact__list dd { margin: 0; word-break: break-word; }
.ts-contact__form { padding: 20px; background: #fff; border-radius: var(--ts-radius); border: 1px solid var(--ts-line); }
.ts-contact__form h2 { margin-top: 0; font-size: 1.25rem; color: var(--ts-purple-800); }
.ts-contact__map { padding: 20px; background: #fff; border-radius: var(--ts-radius); border: 1px solid var(--ts-line); min-width: 0; }
.ts-contact__map h2 { margin-top: 0; font-size: 1.25rem; color: var(--ts-purple-800); }
.ts-contact__map-frame { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #eee; }
.ts-contact__map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ts-contact__map-link { margin: 12px 0 0; }

/* ---------- single contestant */
.ts-single { display: grid; gap: 28px; }
@media (min-width: 860px) { .ts-single { grid-template-columns: 360px 1fr; align-items: start; } .ts-single .ts-grid { grid-template-columns: 1fr; } }
.ts-single .ts-card__actions .ts-link { display: none; }

/* ---------- footer band + FAB */
.ts-footer { background: var(--ts-purple-900) var(--ts-pattern); color: #e9dcf1; padding: 40px 0 24px; }
.ts-footer a { color: var(--ts-gold-300); }
.ts-footer p { margin: 0 0 6px; }
.ts-footer__title { color: #fff; font-weight: 700; font-size: 1.05rem; margin-bottom: 10px !important; }
.ts-footer__grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .ts-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.ts-fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 99; display: none; padding: 14px 22px; border-radius: 999px; background: linear-gradient(180deg, #e2c35f, var(--ts-gold)); color: var(--ts-purple-900) !important; font-weight: 800; text-decoration: none; box-shadow: 0 8px 22px rgb(42 15 61 / 35%); }
@media (max-width: 921px) { .ts-fab { display: inline-block; } }

.ts-prose > :first-child { margin-top: 0; }
.ts-prose ol, .ts-prose ul { padding-left: 1.4em; }
.ts-prose li { margin-bottom: .4em; }
.ts-page { display: grid; gap: 16px; }

/* ---------- home: contestant carousel (all contestants, 1 / 2 / 3 per view) */
.ts-carousel { --gap: 18px; --per-w: 84%; --autoplay: 5s; --ease-out: cubic-bezier(.2, .8, .2, 1); position: relative; }
@media (min-width: 640px) { .ts-carousel { --gap: 24px; --per-w: calc((100% - var(--gap)) / 2); } }
@media (min-width: 1024px) { .ts-carousel { --gap: 28px; --per-w: calc((100% - 2 * var(--gap)) / 3); } }

.ts-carousel__track {
	display: flex; gap: var(--gap); overflow-x: auto; overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory; scroll-padding-inline: 6px;
	padding: 10px 6px 26px; margin: -10px -6px -10px;
	-webkit-overflow-scrolling: touch;
}
.ts-carousel.is-ready .ts-carousel__track { scrollbar-width: none; }
.ts-carousel.is-ready .ts-carousel__track::-webkit-scrollbar { display: none; }
.ts-slide { flex: 0 0 var(--per-w); min-width: 0; display: flex; scroll-snap-align: start; }
.ts-slide > .ts-card { width: 100%; }

/* entrance: cards rise in one after another when the section scrolls into view */
.ts-carousel.is-ready:not(.is-in) .ts-slide { opacity: 0; transform: translateY(36px); }
.ts-carousel.is-in .ts-slide {
	animation: ts-slide-in .8s var(--ease-out) both;
	animation-delay: calc(min(var(--i, 0), 4) * 110ms);
}
@keyframes ts-slide-in { from { opacity: 0; transform: translateY(36px) scale(.96); } to { opacity: 1; transform: none; } }

/* slides partly out of view sink back; the ones in view come forward */
.ts-carousel.is-ready .ts-card {
	transition: transform .6s var(--ease-out), opacity .6s var(--ease-out), box-shadow .35s ease, border-color .35s ease;
	transform: scale(.92); opacity: .5;
}
.ts-carousel.is-ready .ts-slide.is-active .ts-card { transform: none; opacity: 1; }
.ts-carousel.is-ready .ts-slide.is-active .ts-card:hover {
	transform: translateY(-6px); border-color: var(--ts-gold-300);
	box-shadow: 0 0 0 1px var(--ts-gold-300), 0 18px 40px rgb(42 15 61 / 18%);
}
.ts-carousel .ts-card__media img { transition: transform .9s var(--ease-out); }
.ts-carousel .ts-card:hover .ts-card__media img { transform: scale(1.06); }

/* gold sheen sweeps across the photo and the number pops when a card arrives */
.ts-carousel .ts-card__media::after {
	content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-130%) skewX(-18deg);
	background: linear-gradient(100deg, transparent 30%, rgb(255 236 179 / 0%) 35%, rgb(255 236 179 / 45%) 50%, rgb(255 236 179 / 0%) 65%, transparent 70%);
}
.ts-carousel .ts-slide.is-active .ts-card__media::after { animation: ts-sheen 1.3s ease-out .25s both; }
.ts-carousel .ts-slide.is-active .ts-card__no { animation: ts-pop .6s cubic-bezier(.3, 1.6, .5, 1) .15s both; }
@keyframes ts-sheen { to { transform: translateX(130%) skewX(-18deg); } }
@keyframes ts-pop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* controls: counter · scroll progress · prev / play-pause (autoplay ring) / next */
.ts-carousel__bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 20px; margin-top: 18px; }
.ts-carousel__bar[hidden] { display: none; }
.ts-carousel__count { margin: 0; min-width: 7.5ch; font-family: "Prompt", "Sarabun", system-ui, sans-serif; font-weight: 600; color: var(--ts-purple-800); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ts-carousel__count b { color: var(--ts-magenta); font-weight: 700; }
.ts-carousel__scrub { position: relative; height: 4px; border-radius: 4px; background: var(--ts-line); overflow: hidden; }
.ts-carousel__scrub span {
	position: absolute; inset: 0 auto 0 0; width: var(--w, 20%); border-radius: inherit;
	background: linear-gradient(90deg, var(--ts-gold), var(--ts-magenta));
	transform: translateX(var(--x, 0%)); transition: transform .25s ease-out, width .3s ease;
}
.ts-carousel__btns { display: flex; gap: 10px; }
.ts-carousel .ts-carousel__btn {
	position: relative; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; margin: 0;
	border: 2px solid var(--ts-gold-300); border-radius: 50%; background: var(--ts-purple-800); color: var(--ts-gold-100);
	line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgb(42 15 61 / 22%);
	transition: transform .2s var(--ease-out), background-color .2s ease, box-shadow .2s ease;
}
.ts-carousel .ts-carousel__btn:hover, .ts-carousel .ts-carousel__btn:focus { background: var(--ts-purple-600); color: #fff; border-color: var(--ts-gold-300); transform: scale(1.07); box-shadow: 0 6px 20px rgb(102 40 143 / 35%); }
.ts-carousel .ts-carousel__btn:active { transform: scale(.94); }
.ts-carousel .ts-carousel__btn:focus-visible { outline: 3px solid var(--ts-gold); outline-offset: 3px; }
.ts-carousel__btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease-out); }
.ts-carousel__btn[data-ts-prev]:hover svg { transform: translateX(-3px); }
.ts-carousel__btn[data-ts-next]:hover svg { transform: translateX(3px); }
.ts-carousel__ico-play { fill: currentColor !important; stroke-width: 1.5 !important; }
.ts-carousel__ico-play, .ts-carousel.is-stopped .ts-carousel__ico-pause { display: none; }
.ts-carousel.is-stopped .ts-carousel__ico-play { display: block; }
.ts-carousel .ts-carousel__ring { position: absolute; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); transform: rotate(-90deg); pointer-events: none; }
.ts-carousel__ring circle { fill: none; stroke: var(--ts-gold); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.ts-carousel__ring circle.is-running { animation: ts-ring var(--autoplay) linear both; }
.ts-carousel.is-paused .ts-carousel__ring circle { animation-play-state: paused; }
.ts-carousel.is-stopped .ts-carousel__ring { opacity: 0; }
@keyframes ts-ring { to { stroke-dashoffset: 0; } }
.ts-carousel.is-static .ts-carousel__bar { display: none; }
.ts-carousel.is-static .ts-card { transform: none; opacity: 1; }

/* touch devices: the track clips, the rail inside follows the finger (front.js moves it) */
.ts-carousel.is-touch .ts-carousel__track { display: block; overflow: hidden; scroll-snap-type: none; touch-action: pan-y pinch-zoom; overscroll-behavior: auto; }
.ts-carousel__rail { display: flex; gap: var(--gap); will-change: transform; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.ts-carousel.is-touch .ts-slide { scroll-snap-align: none; }
.ts-carousel.is-touch img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.ts-carousel.is-dragging .ts-carousel__scrub span { transition: width .3s ease; }
/* no sticky hover effects after a tap */
.ts-carousel.is-touch .ts-card:hover .ts-card__media img { transform: none; }
.ts-carousel.is-touch.is-ready .ts-slide.is-active .ts-card:hover { transform: none; border-color: var(--ts-line); box-shadow: var(--ts-shadow); }

@media (max-width: 639px) {
	.ts-carousel__bar { grid-template-columns: 1fr auto; }
	.ts-carousel__scrub { grid-column: 1 / -1; grid-row: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.ts-carousel.is-in .ts-slide, .ts-carousel .ts-slide.is-active .ts-card__media::after, .ts-carousel .ts-slide.is-active .ts-card__no { animation: none; }
	.ts-carousel.is-ready:not(.is-in) .ts-slide { opacity: 1; transform: none; }
	.ts-carousel.is-ready .ts-card { transition: opacity .2s linear; transform: none; }
	.ts-carousel .ts-card:hover .ts-card__media img, .ts-carousel.is-ready .ts-slide.is-active .ts-card:hover { transform: none; }
}

/* ---------- button states + press animation
 * Astra paints every <button> on :hover/:focus solid #4f1d73, so a button stayed solid purple after it was
 * clicked (focus remains). Each variant below sets its own hover / focus / pressed colours, and front.js
 * adds a ripple from the tap point (.ts-ripple) plus a ring that springs out on release (.is-pressed). */
.ts-btn, .ts-fab, .ts-btn-link, .ts-lightbox__btn, .ts-lightbox__close, .ts-carousel__btn { -webkit-tap-highlight-color: transparent; }
.ts-btn, .ts-fab { position: relative; overflow: hidden; isolation: isolate; --ts-ripple: rgb(255 255 255 / 45%); --ts-ring: var(--ts-gold-300); }
.ts-btn {
	transition: transform .22s cubic-bezier(.3, 1.5, .5, 1), background-color .2s ease, border-color .2s ease,
		color .2s ease, box-shadow .2s ease, filter .2s ease;
}
.ts-btn:active:not([disabled]), .ts-fab:active { transform: scale(.94); transition-duration: .08s; }
.ts-btn:hover:not([disabled]) { box-shadow: 0 6px 18px rgb(42 15 61 / 18%); }

/* primary — purple, lighter on hover, magenta + gold edge while pressed */
.ts-btn--primary { --ts-ripple: rgb(230 207 134 / 55%); }
.ts-btn--primary:focus { background-color: var(--ts-purple-700); border-color: transparent; }
.ts-btn--primary:hover:not([disabled]) { background-color: var(--ts-purple-600); border-color: transparent; }
.ts-btn--primary:active:not([disabled]) { background-color: var(--ts-magenta); border-color: var(--ts-gold-300); }
.ts-btn--primary[disabled]:hover, .ts-btn--primary[disabled]:focus { background-color: var(--ts-purple-700); border-color: transparent; }
/* "voted for this one" button stays gold in every state */
.ts-card.is-mine .ts-vote-btn, .ts-card.is-mine .ts-vote-btn:focus { background-color: var(--ts-gold); border-color: transparent; }
.ts-card.is-mine .ts-vote-btn:hover:not([disabled]) { background-color: #d9b43c; border-color: transparent; }
.ts-card.is-mine .ts-vote-btn:active:not([disabled]) { background-color: var(--ts-gold-300); border-color: var(--ts-purple-700); }
.ts-card.is-mine .ts-vote-btn { --ts-ripple: rgb(255 255 255 / 60%); --ts-ring: var(--ts-magenta); }

/* gold — brighter on hover, warm amber while pressed */
.ts-btn--gold { --ts-ripple: rgb(255 255 255 / 60%); --ts-ring: #fff3c4; }
.ts-btn--gold:hover { filter: brightness(1.07); box-shadow: 0 8px 22px rgb(201 162 39 / 45%); }
.ts-btn--gold:active { filter: brightness(.95) saturate(1.25); border-color: #fff3c4; }

/* ghost (on the dark hero) — gold tint while pressed */
.ts-btn--ghost { --ts-ripple: rgb(230 207 134 / 45%); }
.ts-btn--ghost:focus { border-color: rgb(255 255 255 / 70%); }
.ts-btn--ghost:hover { border-color: #fff; }
.ts-btn--ghost:active { background-color: rgb(230 207 134 / 28%); border-color: var(--ts-gold-300); color: var(--ts-gold-100) !important; }

/* ghost-dark (outline on white) — cream on hover, lilac + magenta while pressed */
.ts-btn--ghost-dark { --ts-ripple: rgb(163 39 124 / 22%); --ts-ring: var(--ts-magenta); }
.ts-btn--ghost-dark:focus { background-color: transparent; border-color: var(--ts-purple-700); }
.ts-btn--ghost-dark:hover { background-color: var(--ts-gold-100); border-color: var(--ts-purple-700); }
.ts-btn--ghost-dark:active { background-color: #f1e3f6; border-color: var(--ts-magenta); color: var(--ts-magenta) !important; }

/* Google sign-in — neutral greys, Google-blue ripple */
.ts-btn--google { --ts-ripple: rgb(26 115 232 / 22%); --ts-ring: #8ab4f8; }
.ts-btn--google:focus { background-color: #fff; border-color: #dadce0; }
.ts-btn--google:hover { background-color: #f6f6f8; border-color: #c6c9cf; }
.ts-btn--google:active { background-color: #e8f0fe; border-color: #8ab4f8; }

/* text-link button ("ออกจากระบบ") — never a filled block */
.ts-btn-link, .ts-btn-link:hover, .ts-btn-link:focus { background: none; border: 0; color: var(--ts-purple-700); transition: color .2s ease, transform .15s ease; }
.ts-btn-link:hover { color: var(--ts-magenta); }
.ts-btn-link:active { color: var(--ts-magenta); transform: scale(.95); }

/* floating "vote" button on mobile */
.ts-fab { --ts-ripple: rgb(255 255 255 / 60%); --ts-ring: var(--ts-gold-300); transition: transform .22s cubic-bezier(.3, 1.5, .5, 1), filter .2s ease; }
.ts-fab:hover { filter: brightness(1.06); }
.ts-fab:active { filter: brightness(.95) saturate(1.25); }

/* photo buttons on cards — keep the card colour behind the photo */
.ts-card__media:hover, .ts-card__media:focus { background-color: var(--ts-gold-100); border: 0; }
.ts-card__media:active img { transform: scale(.97); transition: transform .12s ease; }

/* lightbox controls — translucent white, gold while pressed */
.ts-lightbox__btn, .ts-lightbox__close { transition: background-color .2s ease, transform .2s cubic-bezier(.3, 1.5, .5, 1), color .2s ease; }
.ts-lightbox__btn:focus, .ts-lightbox__close:focus { background-color: rgb(255 255 255 / 14%); color: #fff; }
.ts-lightbox__btn:hover, .ts-lightbox__close:hover { background-color: rgb(255 255 255 / 26%); color: #fff; }
.ts-lightbox__btn:active, .ts-lightbox__close:active { background-color: rgb(230 207 134 / 45%); color: var(--ts-purple-900); }
.ts-lightbox__btn:active { scale: .9; }
.ts-lightbox__close:active { transform: scale(.9) rotate(90deg); }
.ts-lightbox__btn:focus-visible, .ts-lightbox__close:focus-visible { outline: 3px solid var(--ts-gold-300); outline-offset: 2px; }

/* carousel buttons: plain focus keeps the base colour; pressed = magenta */
.ts-carousel .ts-carousel__btn:focus:not(:hover) { background: var(--ts-purple-800); color: var(--ts-gold-100); transform: none; box-shadow: 0 4px 14px rgb(42 15 61 / 22%); }
.ts-carousel .ts-carousel__btn:active { background: var(--ts-magenta); color: #fff; border-color: var(--ts-gold); transform: scale(.9); transition-duration: .08s; }

/* WPForms submit on the contact page */
.wpforms-container .wpforms-submit { transition: background-color .2s ease, transform .22s cubic-bezier(.3, 1.5, .5, 1) !important; }
.wpforms-container .wpforms-submit:hover { background: #66288f !important; }
.wpforms-container .wpforms-submit:active { background: #a3277c !important; transform: scale(.95); }

/* ripple + release ring */
.ts-ripple {
	position: absolute; z-index: -1; left: var(--x); top: var(--y); width: var(--d); height: var(--d);
	margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2); border-radius: 50%; pointer-events: none;
	background: var(--ts-ripple, rgb(255 255 255 / 45%)); transform: scale(0); opacity: 1;
	animation: ts-ripple .6s cubic-bezier(.2, .7, .3, 1) forwards;
}
@keyframes ts-ripple { 60% { opacity: .9; } to { transform: scale(1); opacity: 0; } }
.is-pressed { animation: ts-press-ring .55s ease-out; }
@keyframes ts-press-ring {
	from { outline: 2px solid var(--ts-ring, var(--ts-gold-300)); outline-offset: 0; }
	to { outline: 2px solid transparent; outline-offset: 10px; }
}

@media (prefers-reduced-motion: reduce) {
	.ts-ripple, .is-pressed { animation: none; }
	.ts-ripple { display: none; }
	.ts-btn:active:not([disabled]), .ts-fab:active, .ts-carousel .ts-carousel__btn:active, .ts-lightbox__btn:active, .ts-lightbox__close:active, .ts-btn-link:active { transform: none; scale: none; }
}

/* ---------- vote page: soft lavender background with the faint diamond pattern (body class from frontend.php) */
body.ts-page-vote, body.ts-page-vote.ast-plain-container, body.ts-page-vote #content {
	background: #f6f0fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%23a3277c' stroke-opacity='.13' stroke-width='1'%3E%3Cpath d='M24 4 44 24 24 44 4 24Z'/%3E%3Cpath d='M24 14 34 24 24 34 14 24Z'/%3E%3Ccircle cx='24' cy='24' r='2'/%3E%3C/g%3E%3C/svg%3E");
}
/* results page: soft mint green, same faint diamond pattern (2026-11-19) */
body.ts-page-results, body.ts-page-results.ast-plain-container, body.ts-page-results #content {
	background: #eef8f0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%232f8f4e' stroke-opacity='.15' stroke-width='1'%3E%3Cpath d='M24 4 44 24 24 44 4 24Z'/%3E%3Cpath d='M24 14 34 24 24 34 14 24Z'/%3E%3Ccircle cx='24' cy='24' r='2'/%3E%3C/g%3E%3C/svg%3E");
}
body.ts-page-vote #content,
body.ts-page-results #content,
body.ts-page-announcements #content,
body.ts-page-contestants #content,
body.ts-page-contact #content { padding-bottom: clamp(32px, 5vw, 56px); }
body.ts-page-vote .ts-account { background: #fffdf8; }

/* Test-mode banner (admin → ธิดาสาเกต → ทดสอบระบบโหวต) */
.ts-test-banner { background: repeating-linear-gradient(-45deg, #fff4d6 0 14px, #fdecbd 14px 28px); border-bottom: 2px solid var(--ts-gold); color: var(--ts-purple-800); text-align: center; padding: 8px 16px; font-size: .95rem; line-height: 1.5; position: relative; z-index: 5; }
.ts-test-banner p { margin: 0 auto; max-width: 1100px; }
.ts-test-banner strong { display: inline-block; margin-right: 6px; padding: 1px 10px; border-radius: 999px; background: var(--ts-purple-700); color: #fff; font-size: .85em; }

/* ---------- hover animations for mouse/trackpad (2026-11-18)
 * Only under (hover: hover) and (pointer: fine) so phones/tablets never keep a "stuck" hover after a tap; touch
 * keeps the ripple + ring above and gets a gentle glow on the floating vote button instead. */
.ts-btn::after {
	content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: 0; width: 55%; pointer-events: none;
	background: linear-gradient(90deg, transparent, var(--ts-sheen, rgb(255 255 255 / 38%)), transparent);
	transform: translateX(-140%) skewX(-20deg);
}
.ts-btn--ghost-dark { --ts-sheen: rgb(201 162 39 / 28%); }
.ts-btn--google { --ts-sheen: rgb(26 115 232 / 12%); }
.ts-btn--gold, .ts-card.is-mine .ts-vote-btn { --ts-sheen: rgb(255 255 255 / 60%); }
@keyframes ts-btn-sheen { from { transform: translateX(-140%) skewX(-20deg); } to { transform: translateX(240%) skewX(-20deg); } }

.ts-link, .ts-news__title a, .ts-footer__grid a:not(.ts-social__link), .ts-social__link {
	text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
	transition: background-size .35s cubic-bezier(.3, 1, .4, 1), color .2s ease;
}
.ts-link__arrow, .ts-social__icon { transition: transform .3s cubic-bezier(.3, 1.5, .5, 1); }
.ts-grid > .ts-card { transition: box-shadow .3s ease, border-color .3s ease, transform .35s cubic-bezier(.3, 1.3, .5, 1); }

@media (hover: hover) and (pointer: fine) {
	.ts-btn:hover:not([disabled]) { transform: translateY(-2px); }
	.ts-btn:hover:not([disabled])::after { animation: ts-btn-sheen .8s ease-out; }
	.ts-btn:hover:active:not([disabled]) { transform: scale(.94); }
	.ts-btn--primary:hover:not([disabled]) { box-shadow: 0 8px 22px rgb(79 29 115 / 32%); }
	.ts-btn--ghost:hover { background-color: rgb(255 255 255 / 14%); box-shadow: 0 0 0 3px rgb(255 255 255 / 14%), 0 8px 22px rgb(0 0 0 / 22%); }

	.ts-fab:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgb(42 15 61 / 42%); }
	.ts-fab:hover:active { transform: scale(.94); }

	.ts-link:hover, .ts-news__title a:hover, .ts-footer__grid a:not(.ts-social__link):hover, .ts-footer .ts-social__link:hover {
		background-size: 100% 2px; text-decoration: none;
	}
	.ts-link:hover { color: var(--ts-magenta); }
	.ts-footer__grid a:hover { color: #fff3c4; }
	.ts-link:hover .ts-link__arrow { transform: translateX(4px); }
	.ts-social__link:hover .ts-social__icon { transform: scale(1.15) rotate(-8deg); }

	.ts-grid > .ts-card:hover { transform: translateY(-4px); border-color: var(--ts-gold-300); box-shadow: 0 14px 34px rgb(42 15 61 / 16%); }

	.ts-lightbox__close:hover { transform: rotate(90deg); }
	.ts-lightbox__close:hover:active { transform: scale(.9) rotate(90deg); }
	.ts-lightbox__btn:hover { scale: 1.1; }
	.ts-lightbox__btn:hover:active { scale: .9; }
	.ts-session-bar__account .ts-session-bar__logout:hover:not([disabled]) { transform: translateY(-1px); }
}

/* touch: the floating vote button glows a few times after the page loads (no hover state on touch) */
@keyframes ts-fab-glow {
	0%, 100% { box-shadow: 0 8px 22px rgb(42 15 61 / 35%), 0 0 0 0 rgb(230 207 134 / 0%); }
	50% { box-shadow: 0 8px 22px rgb(42 15 61 / 35%), 0 0 0 8px rgb(230 207 134 / 45%); }
}
@media (hover: none), (pointer: coarse) {
	.ts-fab { animation: ts-fab-glow 2.2s ease-in-out 1.2s 3; }
}

@media (prefers-reduced-motion: reduce) {
	.ts-btn::after, .ts-fab { animation: none !important; }
	.ts-btn::after { display: none; }
	.ts-btn:hover:not([disabled]), .ts-fab:hover, .ts-grid > .ts-card:hover, .ts-lightbox__close:hover,
	.ts-link:hover .ts-link__arrow, .ts-social__link:hover .ts-social__icon, .ts-session-bar__account .ts-session-bar__logout:hover { transform: none; }
	.ts-btn:hover:active:not([disabled]), .ts-fab:hover:active, .ts-lightbox__close:hover:active { transform: none; }
	.ts-lightbox__btn:hover, .ts-lightbox__btn:hover:active { scale: none; }
	.ts-link, .ts-news__title a, .ts-footer__grid a, .ts-social__link { transition: color .2s linear; }
}

/* ---------- results page: animated link to the big-screen scoreboard */
@property --ts-live-ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.ts-live-cta { display: flex; justify-content: center; margin: 0 0 20px; }
.ts-live-btn {
	position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
	padding: 7px 8px 7px 14px; border-radius: 999px; overflow: hidden;
	color: #fff !important; text-decoration: none !important;
	background: radial-gradient(120% 160% at 0% 0%, #5b1f8f 0%, #2a0f3d 55%, #12052a 100%);
	box-shadow: 0 0 0 1px rgb(201 162 39 / 35%), 0 6px 18px rgb(163 39 124 / 30%), 0 0 16px rgb(169 92 255 / 30%);
	animation: ts-live-glow 2.8s ease-in-out infinite;
	transition: transform .25s cubic-bezier(.2, .9, .3, 1.3), box-shadow .25s ease;
}
/* rotating neon border */
.ts-live-btn::before {
	content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; z-index: -1;
	background: conic-gradient(from var(--ts-live-ang), #c9a227, #ff3fd8, #3ff0ff, #a95cff, #c9a227);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
	mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
	animation: ts-live-spin 3.5s linear infinite;
}
/* scanlines + light sweep */
.ts-live-btn::after {
	content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
	background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 28%) 48%, transparent 62%) no-repeat,
		repeating-linear-gradient(to bottom, rgb(255 255 255 / 5%) 0 1px, transparent 1px 4px);
	background-size: 250% 100%, auto; background-position: 180% 0, 0 0;
	animation: ts-live-sweep 4.2s ease-in-out infinite;
}
.ts-live-btn__ping { position: relative; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #ff2d55; box-shadow: 0 0 10px #ff2d55; }
.ts-live-btn__ping i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #ff2d55; animation: ts-live-ping 1.6s ease-out infinite; }
.ts-live-btn__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; }
.ts-live-btn__kicker {
	font: 700 9px/1 "Prompt", system-ui, sans-serif; letter-spacing: .28em; white-space: nowrap;
	background: linear-gradient(90deg, #3ff0ff, #ffd36b, #ff3fd8, #3ff0ff); background-size: 300% 100%;
	-webkit-background-clip: text; background-clip: text; color: transparent; animation: ts-live-hue 5s linear infinite;
}
.ts-live-btn__label { font: 600 15px/1.2 "Prompt", "Sarabun", system-ui, sans-serif; text-shadow: 0 0 12px rgb(255 63 216 / 55%); }
.ts-live-btn__arrow {
	flex: none; width: 26px; height: 26px; padding: 5px; border-radius: 50%; fill: none; stroke: #2a0f3d; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
	background: linear-gradient(180deg, #ffe39a, #c9a227); box-shadow: 0 0 14px rgb(255 211 107 / 60%);
	animation: ts-live-nudge 1.8s ease-in-out infinite;
}
.ts-live-btn:focus-visible { outline: 3px solid #fff3c4; outline-offset: 4px; }
.ts-live-btn:active { transform: scale(.97); }
@keyframes ts-live-spin { to { --ts-live-ang: 360deg; } }
@keyframes ts-live-sweep { 0%, 55% { background-position: 180% 0, 0 0; } 100% { background-position: -80% 0, 0 0; } }
@keyframes ts-live-ping { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.8); opacity: 0; } }
@keyframes ts-live-hue { to { background-position: -300% 0; } }
@keyframes ts-live-nudge { 0%, 60%, 100% { transform: translateX(0); } 75% { transform: translateX(4px); } }
@keyframes ts-live-glow { 50% { box-shadow: 0 0 0 1px rgb(201 162 39 / 55%), 0 8px 22px rgb(163 39 124 / 42%), 0 0 26px rgb(255 63 216 / 40%); } }
@media (hover: hover) and (pointer: fine) {
	.ts-live-btn:hover { transform: translateY(-2px) scale(1.03); animation-play-state: paused; box-shadow: 0 0 0 1px #e6cf86, 0 10px 26px rgb(163 39 124 / 50%), 0 0 34px rgb(255 63 216 / 50%); }
	.ts-live-btn:hover::before { animation-duration: 1.2s; }
	.ts-live-btn:hover .ts-live-btn__arrow { animation: none; transform: translateX(3px) rotate(-8deg); transition: transform .25s ease; }
	.ts-live-btn:hover:active { transform: translateY(-1px) scale(.99); }
}
@media (prefers-reduced-motion: reduce) {
	.ts-live-btn, .ts-live-btn::before, .ts-live-btn::after, .ts-live-btn__ping i, .ts-live-btn__kicker, .ts-live-btn__arrow { animation: none !important; }
	.ts-live-btn, .ts-live-btn:hover, .ts-live-btn:active { transform: none !important; }
}
