/**
 * Test Your IQ quiz block.
 *
 * Fonts come from --tyiq-font-heading and --tyiq-font-body, set on the block
 * only when the settings pick a font. Unset, they fall back to the theme.
 *
 * Every size is expressed in --u: one pixel of a 1920 px wide reference stage
 * (1080 px in the portrait layout). The stage is an inline-size container, so
 * the game scales with the width of the block. Height is never fixed: each
 * screen is at least as tall as the 16:9 (portrait 9:16) frame of the original
 * kiosk and grows with its content.
 */

/* ---------- block wrapper ---------- */

.tyiq {
	--tyiq-background: #0f2446;
	--tyiq-accent: #bc218b;
	--tyiq-text: #fff;
	--tyiq-button: #f3f3f3;
	--tyiq-button-text: #0f2446;
	--tyiq-answer: #d9d9dc;
	--tyiq-answer-text: #1f3662;
	--tyiq-incorrect: #636567;
	--tyiq-incorrect-text: #f1f1f1;
	--tyiq-panel: #f1f1f1;
	--tyiq-panel-text: #0f2446;
	--tyiq-fact-title: #0f2446;
	--tyiq-fact-text: #fff;
	--tyiq-fact-footnote: #111;
	--tyiq-ui-font: system-ui, -apple-system, "Segoe UI", roboto, sans-serif;
	--tyiq-weight-heading: 800;
	--tyiq-weight-bold: 700;
	--tyiq-weight-semibold: 600;
	--tyiq-weight-regular: 400;
	position: relative;
	box-sizing: border-box;
}

.tyiq tyiq-quiz {
	display: contents;
}

.tyiq .tyiq-defs {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

.tyiq [hidden] {
	display: none !important;
}

.tyiq .tyiq-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---------- stage ---------- */

.tyiq .tyiq-stage {
	--u: calc(100vw / 1920);
	position: relative;
	width: 100%;
	overflow: hidden;
	background: var(--tyiq-background);
	color: var(--tyiq-text);
	font-family: var(--tyiq-font-body);
	line-height: normal;
	container-type: inline-size;
	-webkit-tap-highlight-color: transparent;
	-webkit-user-select: none;
	user-select: none;
	touch-action: manipulation;
}

@supports (width: 1cqw) {

	.tyiq .tyiq-stage {
		--u: calc(100cqw / 1920);
	}

	.tyiq .tyiq-stage[data-layout="portrait"] {
		--u: calc(100cqw / 1080);
	}

	/* A kiosk window fits the whole frame in the window, like the original. */
	.tyiq--fullwindow .tyiq-stage {
		--u: min(calc(100cqw / 1920), calc(100cqh / 1080));
	}

	.tyiq--fullwindow .tyiq-stage[data-layout="portrait"] {
		--u: min(calc(100cqw / 1080), calc(100cqh / 1920));
	}
}

.tyiq--fullwindow .tyiq-stage {
	position: fixed;
	inset: 0;
	z-index: 100000;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	overflow: hidden auto;
	container-type: size;
}

.tyiq .tyiq-stage *,
.tyiq .tyiq-stage *::before,
.tyiq .tyiq-stage *::after {
	box-sizing: border-box;
}

.tyiq .tyiq-stage :where(h2, h3, p, ul, ol, li, dl, dt, dd, .tyiq-footnote, .tyiq-scoring__summary, .tyiq-name__error, .tyiq-question__text) {
	margin: 0;
	padding: 0;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
}

/*
 * Themes often narrow content paragraphs and headings (for example
 * "p { max-width: 55% }" inside a styled group). :not(#tyiq) adds ID-level
 * specificity without an ID, so the game's own layout always wins.
 */
.tyiq .tyiq-stage:not(#tyiq) :where(h2, h3, p) {
	max-width: none;
}

.tyiq .tyiq-stage :where(button) {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	border: 0;
	box-shadow: none;
	text-shadow: none;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	min-height: 0;
	min-width: 0;
	line-height: normal;
	cursor: pointer;
}

.tyiq .tyiq-stage :where(img) {
	display: block;
	max-width: none;
	height: auto;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	-webkit-user-drag: none;
}

.tyiq .tyiq-stage :focus-visible {
	outline: calc(4 * var(--u)) solid var(--tyiq-accent);
	outline-offset: calc(4 * var(--u));
}

/* ---------- screens and the common three-zone layout ---------- */

.tyiq .tyiq-screen {
	position: relative;
	display: none;
	flex-direction: column;

	/* A minimum, not a height: the original frame, or the window when that is
	 * shorter. Content that needs more room makes the screen taller. */
	min-height: min(calc(1080 * var(--u)), 100vh);
	min-height: min(calc(1080 * var(--u)), 100svh);
}

.tyiq .tyiq-stage[data-layout="portrait"] .tyiq-screen {
	min-height: min(calc(1920 * var(--u)), 100vh);
	min-height: min(calc(1920 * var(--u)), 100svh);
}

.tyiq--fullwindow .tyiq-stage .tyiq-screen,
.tyiq--fullwindow .tyiq-stage[data-layout="portrait"] .tyiq-screen {
	min-height: 100%;
}

.tyiq .tyiq-screen.is-active {
	display: flex;
}

.tyiq .tyiq-header {
	flex: 0 0 auto;

	/* Bottom padding: the line box gap under the original's inline logo. */
	padding: calc(43.2 * var(--u)) 2.5% calc(3.99 * var(--u));
}

.tyiq .tyiq-content {
	display: flex;
	flex: 1 0 auto;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 0 2.5%;
}

.tyiq .tyiq-footer {
	display: flex;
	flex: 0 0 auto;
	align-items: flex-end;
	padding: calc(16.2 * var(--u)) 2.5% calc(27 * var(--u));
}

.tyiq .tyiq-footnote {
	flex: 1 1 auto;
	max-width: 35%;
	color: var(--tyiq-text);
	font-family: var(--tyiq-font-body);
	font-weight: var(--tyiq-weight-bold);
	font-size: calc(17.28 * var(--u));
	line-height: 1.42;
}

.tyiq .tyiq-footnote p {
	margin: 0 0 1em;
}

.tyiq .tyiq-footnote--dark {
	color: var(--tyiq-fact-footnote);
}

.tyiq .tyiq-footer__end {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: calc(16.2 * var(--u));
	margin-left: auto;
}

.tyiq .tyiq-footer__logo {
	padding: 0;
	background: none;
}

.tyiq .tyiq-footer__logo-image {
	width: calc(220 * var(--u));
	max-height: calc(64 * var(--u));
	object-fit: contain;
	object-position: right bottom;
}

.tyiq .tyiq-header-logo {
	width: calc(292 * var(--u));
	max-height: calc(110 * var(--u));
	object-fit: contain;
	object-position: left top;
}

.tyiq .tyiq-button {
	border-radius: calc(11 * var(--u));
	background: var(--tyiq-button);
	color: var(--tyiq-button-text);
	font-family: var(--tyiq-font-heading);
	font-weight: var(--tyiq-weight-heading);
	font-size: calc(44.16 * var(--u));
}

.tyiq .tyiq-button:active {
	transform: scale(0.985);
}

.tyiq .tyiq-button--next {
	padding: calc(19.44 * var(--u)) calc(53.76 * var(--u));
}

.tyiq .tyiq-title {
	margin: 0 0 calc(21.6 * var(--u));
	color: var(--tyiq-accent);
	font-family: var(--tyiq-font-heading);
	font-weight: var(--tyiq-weight-heading);
	font-size: calc(80 * var(--u));
	line-height: 1;
	text-align: center;
}

/* ---------- start ---------- */

.tyiq .tyiq-start {
	gap: calc(43.2 * var(--u));
}

.tyiq .tyiq-start__hero {
	align-self: center;
	width: 77.5%;
	max-width: calc(900 * var(--u));
	max-height: calc(520 * var(--u));
	object-fit: contain;
}

.tyiq .tyiq-start__button {
	align-self: center;
	margin-top: calc(43.2 * var(--u));
	padding: calc(21.6 * var(--u)) calc(61.44 * var(--u));
}

/* ---------- how to play ---------- */

.tyiq .tyiq-howto {
	width: 75%;
	max-width: calc(960 * var(--u));
	color: var(--tyiq-text);
}

.tyiq .tyiq-stage:not(#tyiq) .tyiq-howto p {
	margin: 0 0 1.6% !important;
}

.tyiq .tyiq-howto p {
	font-family: var(--tyiq-font-body);
	font-weight: var(--tyiq-weight-semibold);
	font-size: calc(40 * var(--u));
	line-height: 1.25;
}

.tyiq .tyiq-howto ul,
.tyiq .tyiq-howto ol {
	margin: calc(21.6 * var(--u)) 0;
	padding-left: 1.4em;
	font-family: var(--tyiq-font-body);
	font-weight: var(--tyiq-weight-regular);
	font-size: calc(38 * var(--u));
	line-height: 1.25;
}

.tyiq .tyiq-howto ul {
	list-style: disc;
}

.tyiq .tyiq-howto ol {
	list-style: decimal;
}

.tyiq .tyiq-howto li {
	margin: 0 0 0.4em;
	padding-left: 0.4em;
}

/* ---------- scoring ---------- */

.tyiq .tyiq-scoring__summary {
	margin: 0 0 calc(32.4 * var(--u));
	color: var(--tyiq-text);
	font-family: var(--tyiq-font-body);
	font-weight: var(--tyiq-weight-semibold);
	font-size: calc(45 * var(--u));
	text-align: center;
}

.tyiq .tyiq-speed {
	position: relative;
	width: calc(620 * var(--u));
	padding: calc(102.14 * var(--u)) calc(109.44 * var(--u)) calc(72.96 * var(--u));
	border: calc(4 * var(--u)) solid var(--tyiq-text);
	border-radius: calc(30 * var(--u));
}

.tyiq .tyiq-speed__title {
	position: absolute;
	top: 0;
	left: 50%;
	z-index: 1;
	margin: 0;
	padding: 0 calc(21.12 * var(--u));
	transform: translate(-50%, -50%);
	background: var(--tyiq-background);
	color: var(--tyiq-text);
	font-family: var(--tyiq-font-heading);
	font-weight: var(--tyiq-weight-heading);
	font-size: calc(64.32 * var(--u));
	line-height: 1;
	white-space: nowrap;
}

.tyiq .tyiq-speed__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: calc(8.64 * var(--u)) calc(34.56 * var(--u));
	margin: 0;
}

.tyiq .tyiq-speed__grid dt,
.tyiq .tyiq-speed__grid dd {
	margin: 0;
	color: var(--tyiq-text);
	font-family: var(--tyiq-font-body);
	font-weight: var(--tyiq-weight-regular);
	font-size: calc(36.86 * var(--u));
	line-height: 1.18;
	white-space: nowrap;
}

.tyiq .tyiq-speed__grid .tyiq-speed__head {
	margin-bottom: calc(1.25 * var(--u));
	font-family: var(--tyiq-font-body);
	font-weight: var(--tyiq-weight-bold);
}

/* ---------- leaderboard ---------- */

.tyiq .tyiq-leaderboard__header {
	display: flex;
	justify-content: center;
	padding: calc(27 * var(--u)) 5% 0;
}

.tyiq .tyiq-leaderboard__heading {
	width: 84%;
	max-width: calc(1100 * var(--u));
	max-height: calc(160 * var(--u));
	object-fit: contain;
}

.tyiq .tyiq-leaderboard {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: repeat(var(--tyiq-rows, 5), auto);
	grid-auto-flow: column;
	gap: calc(6.48 * var(--u)) 10.5%;
	width: calc(860 * var(--u));
	margin: 0;
	padding: 0;
	list-style: none;
}

.tyiq .tyiq-leaderboard__row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: baseline;
	column-gap: calc(24.96 * var(--u));
	margin: 0;
	color: var(--tyiq-text);
	font-family: var(--tyiq-font-body);
	font-weight: var(--tyiq-weight-bold);
	font-size: calc(63.74 * var(--u));
	line-height: 1.12;
}

.tyiq .tyiq-leaderboard__rank {
	min-width: 2.6ch;
}

.tyiq .tyiq-leaderboard__name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------- name entry ---------- */

.tyiq .tyiq-name {
	align-self: center;
	width: calc(760 * var(--u));
	padding: calc(32.4 * var(--u)) calc(54.72 * var(--u));
	overflow: hidden;
	border-radius: calc(20 * var(--u));
	background: var(--tyiq-answer);
	color: #6c6e79;
	font-family: var(--tyiq-font-heading);
	font-weight: var(--tyiq-weight-heading);
	font-size: calc(94 * var(--u));
	line-height: 1;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.tyiq .tyiq-name.has-value {
	color: var(--tyiq-panel-text);
}

.tyiq .tyiq-name__error {
	margin: calc(10.8 * var(--u)) 0 0;
	color: #ffd3ea;
	font-family: var(--tyiq-font-body);
	font-weight: var(--tyiq-weight-bold);
	font-size: calc(27.65 * var(--u));
	line-height: 1.2;
	text-align: center;
}

.tyiq .tyiq-name__help {
	width: calc(800 * var(--u));
	margin-top: calc(16.2 * var(--u));
}

.tyiq .tyiq-stage:not(#tyiq) .tyiq-name__help p {
	margin: 0 0 calc(14.4 * var(--u)) !important;
}

.tyiq .tyiq-name__help p {
	color: var(--tyiq-text);
	font-family: var(--tyiq-font-body);
	font-weight: var(--tyiq-weight-bold);
	font-size: calc(40 * var(--u));
	line-height: 1.24;
	text-align: center;
}

.tyiq .tyiq-keyboard {
	position: absolute;
	bottom: calc(129.6 * var(--u));
	left: 50%;
	z-index: 3;
	width: calc(700 * var(--u));
	padding: calc(19.2 * var(--u)) calc(23.04 * var(--u));
	transform: translateX(-50%);
	border-radius: calc(18 * var(--u));
	background: #d8d8da;
}

.tyiq .tyiq-keyboard__row {
	display: flex;
	justify-content: center;
	gap: calc(10.56 * var(--u));
	margin-bottom: calc(4.7 * var(--u));
}

.tyiq .tyiq-key {
	min-width: calc(54.72 * var(--u));
	height: calc(66.96 * var(--u));
	padding: calc(1 * var(--u)) calc(6 * var(--u));
	border-radius: calc(10 * var(--u));
	background: #f5f5f6;
	color: #111;
	font-family: var(--tyiq-font-body);
	font-weight: var(--tyiq-weight-bold);
	font-size: calc(36 * var(--u));
	line-height: 1;
}

.tyiq .tyiq-key.is-special {
	min-width: calc(88.32 * var(--u));
	background: #c7c7cb;
}

.tyiq .tyiq-key.is-action {
	min-width: calc(130.56 * var(--u));
	background: #c7c7cb;
}

.tyiq .tyiq-key.is-space {
	min-width: calc(360.96 * var(--u));
}

.tyiq .tyiq-key.is-on {
	background: #fff;
}

/* ---------- question ---------- */

.tyiq .tyiq-quiz-header {
	position: relative;
	z-index: 1;
	display: grid;
	flex: 0 0 auto;
	grid-template-columns: 2fr 6fr 2fr;
	align-items: start;
	padding: 0 2.5%;
}

.tyiq .tyiq-quiz-header__logo {
	display: flex;
	align-items: flex-start;
}

.tyiq .tyiq-quiz-header__timer {
	display: flex;
	justify-content: flex-end;
}

.tyiq .tyiq-header-logo--quiz {
	width: calc(308 * var(--u));
	margin-top: calc(43.2 * var(--u));
}

.tyiq .tyiq-score-panel {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	column-gap: calc(40 * var(--u));
	margin: 0 5%;
	padding: calc(16.2 * var(--u)) 14% calc(27 * var(--u));
	background: var(--tyiq-panel);
}

.tyiq .tyiq-score-panel__block {
	color: var(--tyiq-panel-text);
	font-family: var(--tyiq-font-body);
	font-weight: var(--tyiq-weight-bold);
	text-align: center;
	white-space: nowrap;
}

.tyiq .tyiq-score-panel__label,
.tyiq .tyiq-score-panel__value {
	display: block;
}

.tyiq .tyiq-score-panel__label {
	font-size: calc(44.16 * var(--u));
	line-height: 1.05;
}

.tyiq .tyiq-score-panel__value {
	margin-top: calc(11.91 * var(--u));
	font-size: calc(57.6 * var(--u));
	line-height: 1;
}

.tyiq .tyiq-score-panel__divider {
	align-self: stretch;
	width: 0;
	border-left: calc(3 * var(--u)) solid rgba(15, 36, 70, 0.25);
	border-left-color: color-mix(in srgb, var(--tyiq-panel-text) 25%, transparent);
}

.tyiq .tyiq-timer {
	width: calc(308 * var(--u));
	height: calc(56.16 * var(--u));
	margin-top: calc(43.2 * var(--u));
	padding: calc(1.64 * var(--u)) calc(1.28 * var(--u));
	border: calc(3 * var(--u)) solid #e9e9e9;
	border-radius: calc(10 * var(--u));
}

.tyiq .tyiq-timer__bars {
	display: grid;
	grid-template-columns: repeat(var(--tyiq-cells, 10), 1fr);
	gap: calc(4.608 * var(--u));
	width: 100%;
	height: 100%;
}

.tyiq .tyiq-timer__cell {
	width: 100%;
	height: 100%;
	border-radius: calc(3 * var(--u));
}

.tyiq .tyiq-timer__cell.is-full {
	background: var(--tyiq-accent);
}

.tyiq .tyiq-question {
	display: flex;
	flex: 1 0 auto;
	flex-direction: column;
	align-items: center;
	width: 70.8%;
	margin: 0 auto;
	padding: calc(16.2 * var(--u)) 0 calc(21.6 * var(--u));
}

.tyiq .tyiq-question__title,
.tyiq .tyiq-question__text,
.tyiq .tyiq-option,
.tyiq .tyiq-fact__text,
.tyiq .tyiq-title,
.tyiq .tyiq-final__title {
	overflow-wrap: anywhere;
}

.tyiq .tyiq-question__title {
	margin: 0 0 calc(16.2 * var(--u));
	color: var(--tyiq-accent);
	font-family: var(--tyiq-font-heading);
	font-weight: var(--tyiq-weight-heading);
	font-size: calc(102 * var(--u));
	line-height: 1;
	text-align: center;
}

.tyiq .tyiq-question__text {
	width: 100%;
	margin: 0 0 calc(32.4 * var(--u));
	color: var(--tyiq-text);
	font-family: var(--tyiq-font-body);
	font-weight: var(--tyiq-weight-bold);
	font-size: calc(51.84 * var(--u));
	line-height: 1.14;
	text-align: center;
}

.tyiq .tyiq-options {
	display: grid;
	flex: 0 0 auto;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: repeat(2, 1fr);
	gap: 8% 2.5%;
	width: 91.7%;
	min-height: calc(200 * var(--u));
	margin-top: calc(32.4 * var(--u));
}

.tyiq .tyiq-options[data-count="2"] {
	grid-template-rows: 1fr;
	min-height: calc(92 * var(--u));
}

.tyiq .tyiq-option {
	display: flex;
	align-items: center;
	width: 100%;
	height: 100%;
	padding: calc(12 * var(--u)) 6%;
	border-radius: calc(18 * var(--u));
	background: var(--tyiq-answer);
	color: var(--tyiq-answer-text);
	font-family: var(--tyiq-font-body);
	font-weight: var(--tyiq-weight-semibold);
	font-size: calc(30 * var(--u));
	line-height: 1.12;
	text-align: left;
}

.tyiq .tyiq-option:disabled {
	opacity: 1;
	cursor: default;
}

.tyiq .tyiq-option.is-correct {
	background: var(--tyiq-accent);
	color: var(--tyiq-text);
}

.tyiq .tyiq-option.is-incorrect {
	background: var(--tyiq-incorrect);
	color: var(--tyiq-incorrect-text);
}

.tyiq .tyiq-options.is-waiting .tyiq-option {
	cursor: progress;
}

.tyiq .tyiq-correct-badge {
	position: absolute;
	top: 58%;
	left: 50%;
	z-index: 4;
	width: 21%;
	transform: translate(-50%, -50%);
	pointer-events: none;
}

/* ---------- did you know ---------- */

.tyiq .tyiq-screen--fact {
	background: #fff;
}

.tyiq .tyiq-stage .tyiq-fact__background {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tyiq .tyiq-fact {
	position: relative;
	z-index: 1;
	justify-content: flex-start;
	padding-top: calc(21.6 * var(--u));
}

.tyiq .tyiq-screen--fact .tyiq-footer {
	position: relative;
	z-index: 1;
}

.tyiq .tyiq-fact__title {
	margin: 0 0 calc(21.6 * var(--u));
	color: var(--tyiq-fact-title);
	font-family: var(--tyiq-font-heading);
	font-weight: var(--tyiq-weight-heading);
	font-size: calc(98 * var(--u));
	line-height: 1;
	text-align: center;
}

.tyiq .tyiq-fact__main {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	width: 100%;
}

.tyiq .tyiq-fact__body {
	width: 60%;
}

.tyiq .tyiq-fact__text {
	color: var(--tyiq-fact-text);
	font-family: var(--tyiq-font-body);
	font-weight: var(--tyiq-weight-bold);
	font-size: calc(40 * var(--u));
	line-height: 1.2;
}

.tyiq .tyiq-stage .tyiq-fact__image {
	width: 100%;
	max-height: calc(520 * var(--u));
	object-fit: contain;
	border-radius: calc(2 * var(--u));
}

.tyiq .tyiq-fact__body.is-beside {
	display: grid;
	grid-template-columns: 1fr 0.88fr;
	align-items: center;
	column-gap: 4.6%;
	width: 69%;
}

.tyiq .tyiq-fact__body.is-beside .tyiq-fact__text {
	font-size: calc(34 * var(--u));
	line-height: 1.22;
}

.tyiq .tyiq-fact__body.is-replace {
	width: 65%;
}

/* Reproduces the line box gap under the inline image of the original. */
.tyiq .tyiq-fact__body.is-replace .tyiq-fact__image {
	margin-bottom: calc(3.99 * var(--u));
}

.tyiq .tyiq-fact__button {
	align-self: center;
	margin-top: calc(32.4 * var(--u));
	padding: calc(21.6 * var(--u)) calc(61.44 * var(--u));
}

/* ---------- final score ---------- */

.tyiq .tyiq-final {
	gap: calc(21.6 * var(--u));
}

.tyiq .tyiq-final__title {
	color: var(--tyiq-accent);
	font-family: var(--tyiq-font-heading);
	font-weight: var(--tyiq-weight-heading);
	font-size: calc(108 * var(--u));
	line-height: 1.05;
	text-align: center;
}

.tyiq .tyiq-final__label {
	color: var(--tyiq-text);
	font-family: var(--tyiq-font-body);
	font-weight: var(--tyiq-weight-bold);
	font-size: calc(96 * var(--u));
	line-height: 1;
}

.tyiq .tyiq-final__box {
	display: grid;
	place-items: center;
	width: calc(500 * var(--u));
	padding: calc(32.4 * var(--u)) calc(73 * var(--u));
	border-radius: calc(20 * var(--u));
	background: var(--tyiq-panel);
	color: var(--tyiq-panel-text);
	font-family: var(--tyiq-font-heading);
	font-weight: var(--tyiq-weight-heading);
	font-size: calc(152 * var(--u));
	line-height: 1;
}

.tyiq .tyiq-final__bands {
	margin: calc(21.6 * var(--u)) 0 0;
	padding: 0;
	list-style: none;
}

.tyiq .tyiq-final__bands li {
	margin: 0 0 calc(19.97 * var(--u));
	color: var(--tyiq-text);
	font-family: var(--tyiq-font-body);
	font-weight: var(--tyiq-weight-bold);
	font-size: calc(46 * var(--u));
	line-height: 1.16;
}

/* ---------- new top score ---------- */

.tyiq .tyiq-screen--top {
	background: var(--tyiq-accent);
}

.tyiq .tyiq-top__image {
	align-self: center;
	width: calc(900 * var(--u));
	max-width: 71.5%;
	max-height: calc(640 * var(--u));
	object-fit: contain;
}

/* ---------- status overlay ---------- */

.tyiq .tyiq-overlay {
	position: absolute;
	inset: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 5%;
	background: rgba(15, 36, 70, 0.85);
	background: color-mix(in srgb, var(--tyiq-background) 85%, transparent);
}

.tyiq .tyiq-overlay__panel {
	max-width: calc(1000 * var(--u));
	padding: calc(48 * var(--u)) calc(64 * var(--u));
	border-radius: calc(20 * var(--u));
	background: var(--tyiq-panel);
	color: var(--tyiq-panel-text);
	text-align: center;
}

.tyiq .tyiq-overlay__message {
	font-family: var(--tyiq-font-body);
	font-weight: var(--tyiq-weight-bold);
	font-size: calc(40 * var(--u));
	line-height: 1.25;
}

.tyiq .tyiq-overlay.is-loading .tyiq-overlay__message::before {
	content: "";
	display: block;
	width: calc(64 * var(--u));
	height: calc(64 * var(--u));
	margin: 0 auto calc(24 * var(--u));
	border: calc(8 * var(--u)) solid currentcolor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: tyiq-spin 0.9s linear infinite;
}

.tyiq .tyiq-overlay.is-loading .tyiq-overlay__actions {
	display: none;
}

.tyiq .tyiq-overlay__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: calc(24 * var(--u));
	margin-top: calc(32 * var(--u));
}

.tyiq .tyiq-overlay__button {
	padding: calc(18 * var(--u)) calc(40 * var(--u));
	border: calc(3 * var(--u)) solid var(--tyiq-accent);
	border-radius: calc(11 * var(--u));
	background: var(--tyiq-accent);
	color: #fff;
	font-family: var(--tyiq-font-heading);
	font-weight: var(--tyiq-weight-heading);
	font-size: calc(36 * var(--u));
}

.tyiq .tyiq-overlay__button--secondary {
	border-color: var(--tyiq-panel-text);
	background: transparent;
	color: var(--tyiq-panel-text);
}

@keyframes tyiq-spin {

	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {

	.tyiq .tyiq-overlay.is-loading .tyiq-overlay__message::before {
		animation-duration: 3s;
	}

	.tyiq .tyiq-button:active {
		transform: none;
	}
}

/* ---------- in-game admin panel (logged-in managers only) ---------- */

.tyiq .tyiq-admin {
	position: fixed;
	inset: 0;
	z-index: 100002;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.7);
	font-family: var(--tyiq-ui-font);
	-webkit-user-select: text;
	user-select: text;
}

.tyiq .tyiq-admin__panel {
	display: flex;
	flex-direction: column;
	gap: 20px;
	width: min(700px, 100%);
	max-height: 80vh;
	padding: 32px 36px;
	border-radius: 16px;
	background: #fff;
	color: #0f2446;
}

.tyiq .tyiq-admin__title {
	margin: 0;
	color: #0f2446;
	font-family: var(--tyiq-font-heading);
	font-weight: var(--tyiq-weight-heading);
	font-size: clamp(20px, 2.4vw, 30px);
	line-height: 1.2;
	text-align: center;
}

.tyiq .tyiq-admin__list {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	min-height: 60px;
	max-height: 50vh;
	overflow-y: auto;
}

.tyiq .tyiq-admin__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 14px;
	border-radius: 8px;
	background: #f4f5f7;
	font-size: 16px;
}

.tyiq .tyiq-admin__name {
	overflow: hidden;
	font-weight: 700;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tyiq .tyiq-admin__score {
	margin-left: 12px;
	color: #5a6a7a;
	font-weight: 400;
}

.tyiq .tyiq-admin__empty {
	padding: 20px 0;
	color: #89a;
	text-align: center;
}

.tyiq .tyiq-admin__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 16px;
}

.tyiq .tyiq-admin :where(button) {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 10px 24px;
	border: 2px solid #0f2446;
	border-radius: 8px;
	background: #0f2446;
	color: #fff;
	font: 700 15px/1.2 var(--tyiq-ui-font);
	cursor: pointer;
}

.tyiq .tyiq-admin .tyiq-admin__button--danger,
.tyiq .tyiq-admin .tyiq-admin__delete {
	border-color: #c0392b;
	background: #c0392b;
}

.tyiq .tyiq-admin .tyiq-admin__delete {
	flex: 0 0 auto;
	padding: 6px 14px;
	font-size: 14px;
}

.tyiq .tyiq-admin :where(button):disabled {
	opacity: 0.6;
	cursor: progress;
}

.tyiq .tyiq-noscript {
	margin: 8px 0 0;
	font-size: 14px;
}

/* =====================================================================
 * Portrait layout: narrow blocks and portrait screens.
 * Sizes are pixels of a 1080 × 1920 reference stage.
 * ===================================================================== */

.tyiq [data-layout="portrait"] .tyiq-header {
	padding: calc(60 * var(--u)) 5% 0;
}

.tyiq [data-layout="portrait"] .tyiq-content {
	padding: 0 5%;
}

.tyiq [data-layout="portrait"] .tyiq-footer {
	padding: calc(24 * var(--u)) 5% calc(40 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-footnote {
	max-width: 60%;
	font-size: calc(30 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-footer__end {
	gap: calc(20 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-footer__logo-image {
	width: calc(240 * var(--u));
	max-height: calc(72 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-header-logo,
.tyiq [data-layout="portrait"] .tyiq-header-logo--quiz {
	width: calc(360 * var(--u));
	max-height: calc(130 * var(--u));
	margin-top: 0;
}

.tyiq [data-layout="portrait"] .tyiq-button {
	border-radius: calc(16 * var(--u));
	font-size: calc(56 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-button--next {
	padding: calc(26 * var(--u)) calc(64 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-title {
	margin-bottom: calc(36 * var(--u));
	font-size: calc(96 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-start__hero {
	width: 92%;
	max-width: none;
	max-height: calc(720 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-start__button {
	padding: calc(30 * var(--u)) calc(100 * var(--u));
	font-size: calc(64 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-howto {
	width: 92%;
	max-width: none;
}

.tyiq .tyiq-stage[data-layout="portrait"]:not(#tyiq) .tyiq-howto p {
	margin-bottom: calc(20 * var(--u)) !important;
}

.tyiq [data-layout="portrait"] .tyiq-howto p {
	font-size: calc(44 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-howto ul,
.tyiq [data-layout="portrait"] .tyiq-howto ol {
	margin: calc(28 * var(--u)) 0;
	font-size: calc(42 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-scoring__summary {
	margin-bottom: calc(80 * var(--u));
	font-size: calc(42 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-speed {
	width: 88%;
	padding: calc(110 * var(--u)) calc(60 * var(--u)) calc(70 * var(--u));
	border-radius: calc(36 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-speed__title {
	font-size: calc(68 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-speed__grid {
	gap: calc(14 * var(--u)) calc(30 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-speed__grid dt,
.tyiq [data-layout="portrait"] .tyiq-speed__grid dd {
	font-size: calc(44 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-leaderboard__header {
	padding: calc(70 * var(--u)) 4% 0;
}

.tyiq [data-layout="portrait"] .tyiq-leaderboard__heading {
	width: 96%;
	max-width: none;
}

.tyiq [data-layout="portrait"] .tyiq-leaderboard {
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: none;
	grid-auto-flow: row;
	row-gap: calc(10 * var(--u));
	width: 78%;
}

.tyiq [data-layout="portrait"] .tyiq-leaderboard__row {
	column-gap: calc(40 * var(--u));
	font-size: calc(68 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-name {
	width: 88%;
	padding: calc(40 * var(--u)) 5%;
	border-radius: calc(28 * var(--u));
	font-size: calc(96 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-name__error {
	margin-top: calc(20 * var(--u));
	font-size: calc(38 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-name__help {
	width: 92%;
	margin-top: calc(30 * var(--u));
}

.tyiq .tyiq-stage[data-layout="portrait"]:not(#tyiq) .tyiq-name__help p {
	margin-bottom: calc(20 * var(--u)) !important;
}

.tyiq [data-layout="portrait"] .tyiq-name__help p {
	font-size: calc(44 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-screen--name.is-typing .tyiq-name__help {
	visibility: hidden;
}

.tyiq [data-layout="portrait"] .tyiq-keyboard {
	bottom: calc(330 * var(--u));
	width: 96%;
	padding: calc(20 * var(--u)) calc(14 * var(--u)) calc(10 * var(--u));
	border-radius: calc(26 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-keyboard__row {
	gap: calc(10 * var(--u));
	margin-bottom: calc(12 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-key {
	flex: 1 1 0;
	min-width: 0;
	max-width: calc(96 * var(--u));
	height: calc(118 * var(--u));
	padding: 0;
	border-radius: calc(14 * var(--u));
	font-size: calc(50 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-key.is-special {
	flex-grow: 1.5;
	min-width: 0;
	max-width: calc(150 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-key.is-action {
	flex-grow: 2.4;
	min-width: 0;
	max-width: calc(240 * var(--u));
	font-size: calc(44 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-key.is-space {
	flex-grow: 5;
	min-width: 0;
	max-width: calc(520 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-quiz-header {
	grid-template-columns: 1fr 1fr;
	grid-template-areas:
		"score score"
		"logo timer";
	align-items: center;
	row-gap: calc(28 * var(--u));
	padding: 0 5%;
}

.tyiq [data-layout="portrait"] .tyiq-score-panel {
	grid-area: score;
	margin: 0 4%;
	padding: calc(22 * var(--u)) 15% calc(40 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-score-panel__label {
	font-size: calc(44 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-score-panel__value {
	font-size: calc(62 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-quiz-header__logo {
	grid-area: logo;
}

.tyiq [data-layout="portrait"] .tyiq-quiz-header__timer {
	grid-area: timer;
}

.tyiq [data-layout="portrait"] .tyiq-timer {
	width: calc(300 * var(--u));
	height: calc(68 * var(--u));
	margin-top: 0;
}

.tyiq [data-layout="portrait"] .tyiq-question {
	justify-content: center;
	width: 90%;
	padding: calc(20 * var(--u)) 0 calc(30 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-question__title {
	margin-bottom: calc(24 * var(--u));
	font-size: calc(110 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-question__text {
	margin-bottom: calc(20 * var(--u));
	font-size: calc(54 * var(--u));
	line-height: 1.18;
}

.tyiq [data-layout="portrait"] .tyiq-options,
.tyiq [data-layout="portrait"] .tyiq-options[data-count="2"] {
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: none;
	grid-auto-rows: minmax(calc(130 * var(--u)), auto);
	gap: calc(24 * var(--u));
	width: 100%;
	min-height: 0;
	max-height: none;
}

.tyiq [data-layout="portrait"] .tyiq-option {
	padding: calc(24 * var(--u)) 6%;
	border-radius: calc(24 * var(--u));
	font-size: calc(46 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-correct-badge {
	top: 58%;
	width: 52%;
}

.tyiq [data-layout="portrait"] .tyiq-fact {
	padding-top: calc(40 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-fact__title {
	margin-bottom: calc(40 * var(--u));
	font-size: calc(100 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-fact__body,
.tyiq [data-layout="portrait"] .tyiq-fact__body.is-replace {
	width: 92%;
}

.tyiq [data-layout="portrait"] .tyiq-fact__body.is-beside {
	grid-template-columns: minmax(0, 1fr);
	row-gap: calc(36 * var(--u));
	width: 92%;
}

.tyiq [data-layout="portrait"] .tyiq-fact__image {
	max-height: calc(800 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-fact__text,
.tyiq [data-layout="portrait"] .tyiq-fact__body.is-beside .tyiq-fact__text {
	font-size: calc(50 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-fact__button {
	margin-top: calc(56 * var(--u));
	padding: calc(28 * var(--u)) calc(80 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-final {
	gap: calc(32 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-final__title {
	font-size: calc(96 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-final__label {
	font-size: calc(84 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-final__box {
	width: 64%;
	padding: calc(40 * var(--u)) 5%;
	border-radius: calc(28 * var(--u));
	font-size: calc(150 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-final__bands {
	max-width: 94%;
}

.tyiq [data-layout="portrait"] .tyiq-final__bands li {
	margin-bottom: calc(14 * var(--u));
	font-size: calc(42 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-top__image {
	width: 92%;
	max-width: none;
	max-height: calc(1000 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-overlay__panel {
	max-width: 92%;
	padding: calc(56 * var(--u)) calc(48 * var(--u));
	border-radius: calc(28 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-overlay__message {
	font-size: calc(46 * var(--u));
}

.tyiq [data-layout="portrait"] .tyiq-overlay__button {
	font-size: calc(44 * var(--u));
}
