/* ==========================================================================
   Play posts: quizzes, guess-the-game rounds, played checklists, head-to-head
   picks. Loaded only on posts that hold a [data-htvg-play] block. Every colour
   is a --htvg-* token, so light and dark mode both work.

   Before htvg-play.js runs (.is-live) the block is a readable list, which is
   also what a reader with no scripts gets.
   ========================================================================== */

.htvg-play { margin: 0 0 32px; }

.htvg-prose .htvg-play ol,
.htvg-prose .htvg-play ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.htvg-prose .htvg-play li { margin: 0; }
.htvg-article .htvg-prose .htvg-play ul > li::marker { content: none; }
.htvg-prose .htvg-play img { display: block; width: 100%; height: auto; }

/* ---------- Progress bar -------------------------------------------------- */

.htvg-play__bar {
	position: sticky;
	top: 0;
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;
	margin: 0 0 18px;
	padding: 10px 0;
	background: var(--htvg-bg);
	border-bottom: 1px solid var(--htvg-hair);
}
.htvg-play__count {
	font-family: var(--htvg-font-mono);
	font-size: 13px;
	color: var(--htvg-muted);
}
.htvg-play__meter {
	flex: 1 1 120px;
	height: 6px;
	border-radius: 999px;
	overflow: hidden;
	background: var(--htvg-hair-light);
}
.htvg-play__meter i {
	display: block;
	height: 100%;
	width: 0;
	background: var(--htvg-pink);
	transition: width 0.2s ease;
}

/* ---------- Questions ----------------------------------------------------- */

.htvg-play__qs { counter-reset: htvg-q; }

.htvg-play__q {
	counter-increment: htvg-q;
	padding: 24px 0;
	border-bottom: 1px solid var(--htvg-hair);
	scroll-margin-top: 56px;
}
.htvg-play__q:first-child { padding-top: 4px; }

.htvg-prose .htvg-play__prompt {
	font-family: var(--htvg-font-head);
	font-weight: 800;
	font-size: 22px;
	line-height: 1.25;
	letter-spacing: -0.02em;
	color: var(--htvg-ink);
	margin: 0 0 14px;
}
.htvg-play__prompt::before {
	content: counter(htvg-q) ". ";
	color: var(--htvg-pink-ink);
}
/* Same shape for every question, held open before the picture loads, so a
 * picture arriving above a question never pushes the page while someone reads. */
.htvg-prose .htvg-play__qimg { margin: 0 0 14px; }
.htvg-prose .htvg-play__qimg img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1200 / 628;
	object-fit: cover;
	border-radius: 12px;
	margin: 0;
}

.htvg-prose .htvg-play__opts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin-bottom: 14px;
}
.htvg-prose .htvg-play__opts:has(> li:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) {
	.htvg-prose .htvg-play__opts,
	.htvg-prose .htvg-play__opts:has(> li:nth-child(3):last-child) { grid-template-columns: minmax(0, 1fr); }
}
/* The plain list, before the script turns options into buttons. */
.htvg-play:not(.is-live) .htvg-play__opts > li {
	padding: 10px 14px;
	border: 1px solid var(--htvg-hair);
	border-radius: 12px;
}

.htvg-play__opt {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 48px;
	padding: 11px 16px;
	text-align: left;
	font-family: var(--htvg-font-body);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.35;
	color: var(--htvg-ink);
	background: var(--htvg-soft);
	border: 2px solid var(--htvg-hair);
	border-radius: 12px;
	cursor: pointer;
}
.htvg-play__opt:hover:not(:disabled) { border-color: var(--htvg-cyan-ink); }
.htvg-play__opt:disabled { cursor: default; }
.htvg-play__opt.is-picked { border-color: var(--htvg-pink-ink); box-shadow: inset 0 0 0 1px var(--htvg-pink-ink); }
.htvg-play__opt.is-right { border-color: var(--htvg-cyan-ink); box-shadow: inset 0 0 0 1px var(--htvg-cyan-ink); font-weight: 700; }
.htvg-play__opt.is-right::after { content: " \2713"; color: var(--htvg-cyan-ink); }
.htvg-play__opt.is-wrong { border-color: var(--htvg-pink-ink); }
.htvg-play__opt.is-wrong::after { content: " \2717"; color: var(--htvg-pink-ink); }

.htvg-prose .htvg-play__verdict {
	font-family: var(--htvg-font-head);
	font-weight: 800;
	font-size: 17px;
	margin: 0 0 4px;
}
.htvg-play__verdict.is-right { color: var(--htvg-cyan-ink); }
.htvg-play__verdict.is-wrong { color: var(--htvg-pink-ink); }

.htvg-play__why summary {
	cursor: pointer;
	font-size: 15px;
	color: var(--htvg-cyan-ink);
	min-height: 28px;
}
.htvg-play.is-live .htvg-play__why summary { display: none; }
/* In play, the answer is only opened by answering. */
.htvg-play.is-live .htvg-play__q:not(.is-answered) .htvg-play__why { display: none; }
.htvg-prose .htvg-play__why p { margin: 6px 0 12px; }

.htvg-play__next { margin-top: 2px; }

/* ---------- Results ------------------------------------------------------- */

.htvg-play__tiers { display: none; }
.htvg-play:not(.is-live) .htvg-play__tiers { display: block; margin-top: 20px; }
.htvg-play:not(.is-live) .htvg-play__tiers > li { margin-bottom: 8px; }

.htvg-play__result {
	margin: 24px 0;
	padding: 24px;
	border: 2px solid var(--htvg-ink);
	border-radius: 18px;
	background: var(--htvg-soft);
	text-align: center;
}
.htvg-play__result:focus,
.htvg-play__result:focus-visible { outline: none; box-shadow: none; }
.htvg-prose .htvg-play__kicker {
	font-family: var(--htvg-font-mono);
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--htvg-muted);
	margin: 0 0 4px;
}
.htvg-prose .htvg-play__big {
	font-family: var(--htvg-font-head);
	font-weight: 800;
	font-size: 44px;
	line-height: 1.1;
	letter-spacing: -0.03em;
	color: var(--htvg-pink-ink);
	margin: 0 0 8px;
}
.htvg-prose .htvg-play__label {
	font-family: var(--htvg-font-head);
	font-weight: 800;
	font-size: 22px;
	line-height: 1.25;
	color: var(--htvg-ink);
	margin: 0 0 6px;
}
.htvg-prose .htvg-play__text { margin: 0 auto 14px; max-width: 56ch; }
.htvg-play__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-top: 14px;
}
.htvg-prose .htvg-play__post {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 18px;
	margin: 12px 0 0;
	font-size: 14px;
}

/* ---------- Personality results ------------------------------------------- */

.htvg-play__all { margin-top: 24px; }
.htvg-play__all > summary {
	cursor: pointer;
	font-family: var(--htvg-font-head);
	font-weight: 700;
	font-size: 16px;
	color: var(--htvg-cyan-ink);
	min-height: 32px;
}
.htvg-play__res {
	margin: 18px 0 0;
	padding-top: 18px;
	border-top: 1px solid var(--htvg-hair);
}
.htvg-prose .htvg-play__res h3 { margin-top: 0; }
.htvg-play__res figure { margin: 0 0 12px; }
.htvg-play__result .htvg-play__res { margin: 8px 0 0; padding: 0; border: 0; }
.htvg-play__result .htvg-prose h3,
.htvg-prose .htvg-play__result .htvg-play__res h3 { text-align: center; font-size: 28px; }

/* ---------- Guess the game ------------------------------------------------ */

/* The picture stays hidden until its tiles are in place, so nothing flashes.
   Readers with no scripts get a <noscript> style that shows it (inc/play.php). */
.htvg-play--guess:not(.is-ready) .htvg-play__art img { visibility: hidden; }

.htvg-play--guess:not(.is-live) .htvg-play__round { margin-bottom: 18px; }
.htvg-play__panel { scroll-margin-top: 8px; }
.htvg-prose .htvg-play__status {
	font-family: var(--htvg-font-mono);
	font-size: 13px;
	color: var(--htvg-muted);
	margin: 0 0 10px;
}
.htvg-play__art {
	position: relative;
	overflow: hidden;
	border-radius: 14px;
	margin: 0 auto 14px !important;
	background: var(--htvg-placeholder);
}
.htvg-play--guess[data-mode="cover"] .htvg-play__art { max-width: 340px; }
.htvg-prose .htvg-play__art img { border-radius: 0; }

.htvg-play__tiles {
	position: absolute;
	inset: 0;
	display: grid;
}
.htvg-play__tiles span {
	background: var(--htvg-dark);
	box-shadow: inset 0 0 0 1px var(--htvg-dark-rule);
	transition: opacity 0.25s ease;
}
.htvg-play__tiles span.is-open { opacity: 0; }

.htvg-play__panel { text-align: center; }
.htvg-play__controls { text-align: center; }
.htvg-prose .htvg-play__hint { margin: 0 0 10px; font-size: 15px; color: var(--htvg-body2); }
.htvg-play__form {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	max-width: 520px;
	margin: 0 auto;
}
.htvg-play__form[hidden] { display: none; }
.htvg-play__input {
	flex: 1 1 220px;
	min-height: 44px;
	padding: 8px 16px;
	font-family: var(--htvg-font-body);
	font-size: 16px; /* under 16px, iOS zooms the page when the field gets focus */
	color: var(--htvg-ink);
	background: var(--htvg-bg);
	border: 2px solid var(--htvg-field);
	border-radius: 999px;
}
.htvg-play__input:focus { border-color: var(--htvg-cyan-ink); outline: none; }
.htvg-prose .htvg-play__feedback { min-height: 26px; margin: 8px 0 0; font-size: 15px; color: var(--htvg-pink-ink); }
.htvg-prose .htvg-play__answer {
	font-family: var(--htvg-font-head);
	font-weight: 800;
	font-size: 24px;
	line-height: 1.2;
	color: var(--htvg-ink);
	margin: 0 0 6px;
}
.htvg-prose .htvg-play__line { margin: 0 auto 12px; max-width: 60ch; }
.htvg-play__answers { margin-top: 8px; }
.htvg-play__answers > summary {
	cursor: pointer;
	font-family: var(--htvg-font-head);
	font-weight: 700;
	font-size: 16px;
	color: var(--htvg-cyan-ink);
	min-height: 32px;
}
.htvg-prose .htvg-play__answers ol { counter-reset: htvg-a; margin-top: 10px; }
.htvg-prose .htvg-play__answers li {
	counter-increment: htvg-a;
	padding: 8px 0;
	border-bottom: 1px solid var(--htvg-hair-light);
}
.htvg-play__answers li::before {
	content: counter(htvg-a) ". ";
	font-family: var(--htvg-font-mono);
	font-size: 14px;
	color: var(--htvg-muted);
}

/* ---------- Played checklist ---------------------------------------------- */

.htvg-prose .htvg-play__games {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
	column-gap: 24px;
}
.htvg-play__game {
	position: relative;
	padding: 10px 0;
	border-bottom: 1px solid var(--htvg-hair-light);
}
.htvg-play.is-live .htvg-play__game { padding-left: 38px; }
.htvg-play__name {
	display: block;
	font-family: var(--htvg-font-head);
	font-weight: 700;
	font-size: 17px;
	line-height: 1.3;
	color: var(--htvg-ink);
}
label.htvg-play__name { cursor: pointer; }
.htvg-play__note { display: block; font-size: 14px; line-height: 1.4; color: var(--htvg-muted); }
.htvg-play__check {
	position: absolute;
	left: 0;
	top: 11px;
	width: 26px;
	height: 26px;
	margin: 0;
	accent-color: var(--htvg-pink-ink);
	cursor: pointer;
}
.htvg-play__game.is-checked .htvg-play__name { color: var(--htvg-pink-ink); }

.htvg-play__tally {
	position: sticky;
	bottom: 0;
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	margin-top: 14px;
	padding: 12px 0;
	background: var(--htvg-bg);
	border-top: 2px solid var(--htvg-ink);
}
.htvg-play__tally-text {
	font-family: var(--htvg-font-head);
	font-weight: 800;
	font-size: 18px;
	color: var(--htvg-ink);
}

/* ---------- Versus -------------------------------------------------------- */

.htvg-play__stage { margin-bottom: 28px; scroll-margin-top: 8px; }
.htvg-play__stage[hidden] { display: none; }
.htvg-play__duel {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 12px;
}
.htvg-play__pick {
	display: block;
	width: 100%;
	padding: 0 0 12px;
	background: var(--htvg-soft);
	border: 2px solid var(--htvg-hair);
	border-radius: 16px;
	overflow: hidden;
	cursor: pointer;
	text-align: center;
	color: var(--htvg-ink);
}
.htvg-play__pick:hover { border-color: var(--htvg-pink-ink); }
.htvg-prose .htvg-play__pick img {
	border-radius: 0;
	aspect-ratio: 1200 / 628;
	object-fit: cover;
	margin-bottom: 10px;
}
.htvg-play__pick-name {
	display: block;
	padding: 0 10px;
	font-family: var(--htvg-font-head);
	font-weight: 800;
	font-size: 18px;
	line-height: 1.2;
}
.htvg-play__vs {
	font-family: var(--htvg-font-mono);
	font-weight: 700;
	font-size: 15px;
	color: var(--htvg-pink-ink);
}
@media (max-width: 560px) {
	.htvg-play__duel { grid-template-columns: 1fr; }
	.htvg-play__vs { text-align: center; }
}
.htvg-prose .htvg-play__champ-name {
	font-family: var(--htvg-font-head);
	font-weight: 800;
	font-size: 28px;
	line-height: 1.15;
	color: var(--htvg-ink);
	margin: 12px 0 6px;
}
.htvg-prose .htvg-play__runner { margin: 0 0 8px; font-size: 14px; color: var(--htvg-muted); }
.htvg-prose .htvg-play__entrants {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
	gap: 20px;
}
.htvg-prose .htvg-play__entrant figure { margin: 0 0 8px; }
.htvg-prose .htvg-play__entrant h3 { margin: 0 0 4px; font-size: 18px; }
.htvg-prose .htvg-play__blurb { margin: 0; font-size: 15px; line-height: 1.5; color: var(--htvg-body2); }

@media (prefers-reduced-motion: reduce) {
	.htvg-play__meter i,
	.htvg-play__tiles span { transition: none; }
}
