/* ==========================================================================
   Quiz — изолированная страница спецпроекта
   Подключение локальных шрифтов (Source Serif 4 + Steinbeck), изоляция от темы.
   ========================================================================== */

@font-face {
	font-family: "Source Serif 4";
	src: url("./fonts/subset-SourceSerif4-Regular.woff2") format("woff2"),
		url("./fonts/subset-SourceSerif4-Regular.woff") format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Source Serif 4";
	src: url("./fonts/subset-SourceSerif4-Italic.woff2") format("woff2"),
		url("./fonts/subset-SourceSerif4-Italic.woff") format("woff");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Source Serif 4";
	src: url("./fonts/subset-SourceSerif4-Medium.woff2") format("woff2"),
		url("./fonts/subset-SourceSerif4-Medium.woff") format("woff");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Source Serif 4";
	src: url("./fonts/subset-SourceSerif4-MediumItalic.woff2") format("woff2"),
		url("./fonts/subset-SourceSerif4-MediumItalic.woff") format("woff");
	font-weight: 500;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Source Serif 4";
	src: url("./fonts/subset-SourceSerif4-Bold.woff2") format("woff2"),
		url("./fonts/subset-SourceSerif4-Bold.woff") format("woff");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Source Serif 4";
	src: url("./fonts/subset-SourceSerif4-BoldItalic.woff2") format("woff2"),
		url("./fonts/subset-SourceSerif4-BoldItalic.woff") format("woff");
	font-weight: 700;
	font-style: italic;
	font-display: swap;
}

/* Sans для квиза (Regular + Medium в UI). */
@font-face {
	font-family: "QuizSteinbeck";
	src: url("../fonts/SteinbeckRegular.woff") format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "QuizSteinbeck";
	src: url("../fonts/SteinbeckRegular.woff") format("woff");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

:root {
	--bg: #ffffff;
	--bg-soft: #F4F4F4;
	--ink: #1B1B1B;
	--ink-dark: #000;
	--ink-2: #2a2a2a;
	--muted: color-mix(in srgb, var(--ink) 60%, transparent);
	--line: color-mix(in srgb, var(--ink) 20%, transparent);
	--line-strong: #1B1B1B;
	--accent: #c8102e;
	--accent-soft: #fbe6ea;
	--highlight: #EBFE59;
	--mismatch: #FF47AB;
	--highlight-hover: color-mix(in srgb, var(--highlight) 85%, #ffffff);
	--ok: #1f5e3a;
	--serif: "Source Serif 4";
	--sans: "QuizSteinbeck";
	--maxw: 784px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-weight: normal;
	font-size: 16px;
	line-height: 1.4;
	-webkit-font-smoothing: auto;
	-moz-osx-font-smoothing: auto;
	text-rendering: auto;
}

/* ---------- Layout ---------- */
.quiz-page {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 0 32px 0 32px;
}

.quiz-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid var(--line-strong);
	padding-top: 22px;
	padding-bottom: 18px;
	margin-bottom: 36px;
	font-family: var(--sans);
	font-size: 12px;
	text-transform: uppercase;
	color: var(--ink);
}
.quiz-brand-link {
	display: inline-flex;
	align-items: center;
	line-height: 0;
}
.quiz-brand-link .quiz-custom-logo {
	display: block;
	width: auto;
	max-width: 105px;
}
.quiz-progress {
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}
.quiz-name {
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--ink);
	opacity: .6;
}
/* .quiz-progressbar {
	height: 2px;
	background: var(--line);
	margin: -28px 0 28px;
	position: relative;
}
.quiz-progressbar > span {
	display: block;
	height: 100%;
	background: var(--accent);
	width: 0%;
	transition: width .35s ease;
} */

/* ---------- Карточки (экраны) ---------- */
.quiz-card {
	display: none;
	animation: fadeIn .35s ease both;
}
.quiz-card.quiz-active { display: block; }
@keyframes fadeIn {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ---------- Типографика ---------- */

.quiz-page h1,
.quiz-page h2 {
	font-family: var(--serif);
	font-weight: 500;
	color: var(--ink);
	margin: 0 0 20px;
	font-size: 40px;
	line-height: 1;
	letter-spacing: 0;
}
h3 {
	font-family: var(--serif);
	font-weight: 500;
	color: var(--ink);
	margin: 40px 0 31px 0;
	font-size: 24px;
	line-height: 1;
	letter-spacing: 0;
}
.quiz-description {
	font-family: var(--sans);
	font-weight: 400;
	font-size: 18px;
	line-height: 1.4;
	letter-spacing: 0;
	color: var(--ink);
}
.quiz-description p {
	margin: 0 0 12px;
}
.quiz-description p:last-child {
	margin-bottom: 0;
}
.quiz-description a {
	color: var(--ink);
	text-decoration: underline;
}
.quiz-description a:hover {
	text-decoration: none;
}

.quiz-note {
	color: var(--muted);
	margin: 20px 0;
}
.quiz-rule {
	border: 0;
	border-top: 1px solid var(--line);
	margin: 28px 0;
}
.quiz-rule-strong { border-top-color: var(--line-strong); }

/* ---------- Intro ---------- */
.quiz-intro-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	padding: 14px 0;
	margin: 20px 0;
	font-size: 16px;
	line-height: 1.4;
}
.quiz-intro-meta-stats {
	display: flex;
	gap: 11px;
	flex-wrap: wrap;
	flex: 1;
	min-width: 0;
}
.quiz-intro-meta .quiz-btn {
	flex-shrink: 0;
}
.quiz-intro-meta b {
	font-weight: 400;
	color: var(--ink);
	-webkit-text-stroke: 0.02em var(--ink);
	paint-order: stroke fill;
}

/* ---------- Case card ---------- */
.quiz-case-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	margin-bottom: 8px;
	margin-top: -16px;
}

.quiz-case-meta-result {
	margin-top: 0;
	margin-bottom: 16px;
}

.quiz-case-meta-text {
	display: flex;
	gap: 16px;
	flex: 1;
	min-width: 0;
	font-family: var(--serif);
	font-size: 20px;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.quiz-case-meta .quiz-region {
	color: color-mix(in srgb, var(--ink) 60%, transparent);
}

.quiz-case-meta-pic {
	flex: 0 0 64px;
}

.quiz-case-meta-pic img {
	display: block;
	width: 64px;
	height: 64px;
}

.quiz-article-box {
	padding: 16px 20px;
	margin: 28px 0 28px;
	background: var(--bg-soft);
	font-family: var(--serif);
	font-style: italic;
	font-size: 16px;
	line-height: 1.4;
	color: var(--ink-dart);
	border-radius: 8px;
}

.quiz-question {
	font-family: var(--serif);
	font-size: 28px;
	line-height: 1;
	font-weight: 500;
	margin: 40px 0 28px;
}

/* ---------- Опции ответа ---------- */
.quiz-options {
	display: flex;
	flex-direction: column;
	gap: 20px;
}
.quiz-option {
	appearance: none;
	background: #fff;
	border: 1px solid rgba(0,0,0,.2);
	border-radius: 8px;
	padding: 9px;
	text-align: left;
	font: inherit;
	font-size: 16px;
	line-height: 1.4;
	color: var(--ink);
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
	display: flex;
	gap: 19px;
	align-items: flex-start;
}
.quiz-option:not([disabled]):hover {
	background: var(--highlight);
	border-color: var(--highlight);
}
.quiz-option:not([disabled]):hover .quiz-option-marker {
	background: #fff;
}
.quiz-option .quiz-option-marker {
	display: inline-block;
	width: 36px;
	height: 36px;
	border-radius: 4px;
	text-align: center;
	font-family: var(--serif);
	font-size: 16px;
	line-height: 1.4;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bg-soft);
}
.quiz-option.quiz-selected-match {
	background: var(--ink);
	border-color: var(--ink);
	color: #fff;
	opacity: 1 !important;
}
.quiz-option.quiz-selected-match .quiz-option-marker {
	background: var(--highlight);
	color: var(--ink);
}
.quiz-option.quiz-selected-mismatch {
	background: color-mix(in srgb, var(--mismatch) 20%, transparent);
}
.quiz-option.quiz-selected-mismatch .quiz-option-marker {
	background: var(--mismatch);
	color: #fff;
}


.quiz-option:disabled {
	cursor: default;
	opacity: 0.6;
}
.quiz-option.quiz-selected:disabled {
	opacity: 1; 
}

.quiz-option-text {
	padding-top: 7px;
}
/* ---------- Reveal ---------- */
.quiz-reveal {
	display: none;
	margin-top: 23px;
}
.quiz-reveal.quiz-show { display: block; animation: fadeIn .4s ease both; }
.quiz-reveal .quiz-verdict-header {
	font-family: var(--serif);
	font-size: 20px;
	line-height: 1;
	font-style: italic;
	color: var(--highlight);
	margin-bottom: 8px;
	display: flex;
	gap: 8px;
}
.quiz-reveal .quiz-verdict-header.quiz-verdict-header-mismatch {
	color: var(--mismatch);
}
.quiz-reveal .quiz-verdict-status {
	font-style: normal;
	font-weight: 500;
}
.quiz-reveal .quiz-verdict-header.quiz-verdict-header-mismatch .quiz-verdict-status {
	color: var(--mismatch);
}
.quiz-reveal .quiz-verdict-text {
	font-family: var(--serif);
	font-size: 16px;
	line-height: 1.4;
	font-style: italic;
}
.quiz-reveal .quiz-court {
	margin-top: 29px;
	color: var(--muted);
}
.quiz-delta-line {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	padding: 8px 12px;
	border: 1px solid var(--line);
	background: var(--bg-soft);
}
.quiz-delta-line .quiz-badge {
	font-family: var(--serif);
	font-weight: 500;
	font-size: 14px;
	padding: 1px 8px;
	color: #fff;
	background: var(--ink);
}
.quiz-delta-line.quiz-harsher .quiz-badge { background: var(--accent); }
.quiz-delta-line.quiz-softer  .quiz-badge { background: #4a4a4a; }
.quiz-delta-line.quiz-equal   .quiz-badge { background: var(--ok); }

/* ---------- Кнопки навигации ---------- */
.quiz-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin: 32px 0 20px 0;
}
.quiz-btn {
	appearance: none;
	border: 0;
	background: var(--highlight);
	color: var(--ink);
	padding: 10px 20px;
	font: normal 18px/1.4 var(--sans);
	cursor: pointer;
	transition: background .15s ease;
	border-radius: 8px;
	-webkit-text-stroke: 0.02em var(--ink);
	text-decoration: none !important;
}
.quiz-btn:hover {
	background: var(--highlight-hover);
}
.quiz-btn.quiz-ghost {
	background: transparent;
	color: color-mix(in srgb, var(--ink) 60%, transparent);
	padding: 12px 0px;
}
.quiz-btn.quiz-ghost:hover { color: var(--ink); background: transparent; }
.quiz-btn[disabled] {
	background: color-mix(in srgb, var(--muted) 20%, transparent);
	color: color-mix(in srgb, var(--muted) 50%, transparent);
	cursor: not-allowed;
}


/* ---------- Финальная карточка ---------- */
.quiz-card h1 em,
.quiz-card h2 em {
	font-style: normal;
	color: var(--ink);
	background: var(--highlight);
}

.quiz-scale-wrap {
	margin: 111px 0 65px;
}
.quiz-scale-labels {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 14px;
}
.quiz-scale {
	position: relative;
	height: 8px;
	background: linear-gradient(to right, var(--mismatch) 0%, color-mix(in srgb, #C5C5C5 20%, transparent) 50%, var(--highlight) 100%);
	margin: 0 0 70px;
}
.quiz-scale .quiz-tick {
	position: absolute;
	top: -8px;
	width: 2px;
	height: 24px;
	background: var(--ink);
	transform: translateX(-1px);
}

.quiz-scale .quiz-marker {
	position: absolute;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	transform: translateX(-50%);
}

.quiz-scale .quiz-judge-marker {
	left: 50%;
	top: -46px;
	width: 160px;
}

.quiz-scale .quiz-dot {
	width: 20px;
	height: 18px;
	margin: 0 auto;
}

.quiz-scale .quiz-dot img {
	display: block;
}

.quiz-scale .quiz-judge-marker .quiz-dot {
	transform: rotate(180deg);
}

.quiz-scale .quiz-lbl {
	font-family: var(--serif);
	font-style: italic;
	font-weight: normal;
	font-size: 20px;
	line-height: 1.4;
}
.quiz-scale .quiz-you-marker {
	top: 8px;
	width: 130px;
	transition: left .9s cubic-bezier(.2,.7,.2,1);
}

.quiz-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	margin: 65px 0 40px;
}
.quiz-stats > div {
	padding: 10px 12px 12px 12px;
	border-radius: 8px;
	background: var(--bg-soft);
}
.quiz-stats > div:last-child { border-right: 0; }
.quiz-stats .quiz-n {
	font-family: var(--serif);
	color: #000;
	font-size: 36px;
	line-height: 1;
	font-style: italic;
	margin-bottom: 4px;
}
.quiz-stats .quiz-lbl {
	-webkit-text-stroke: 0.015em var(--ink);
	paint-order: stroke fill;
}

.quiz-summary {
	margin-top: 40px;
	margin-bottom: 40px;
}

.quiz-summary-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.quiz-summary-row {
	display: flex;
	gap: 24px;
	align-items: center;
	font-family: var(--serif);
	font-size: 18px;
	line-height: 1.1;
	font-weight: normal;
	letter-spacing: -0.02em;
}
.quiz-summary-row .quiz-ttl {
	flex-grow: 1;
}
.quiz-verdict {
	display: flex;
	gap: 32px;
	background: linear-gradient(to top right, #424242 0%, #272626 100%);
	border-radius: 8px;
	padding: 20px 20px 20px 0;
	color: #fff;
}

.quiz-verdict-pic img {
	display: block;
}

.quiz-summary-row .quiz-verdict-chip {
	font-family: var(--serif);
	font-size: 18px;
	line-height: 1.1;
	letter-spacing: -0.02em;
	padding: 8px 12px;
	border-radius: 8px;
	white-space: nowrap;
}
.quiz-summary-row .quiz-verdict-chip.quiz-match {
	background: var(--bg-soft);
	color: var(--ink);
}
.quiz-summary-row .quiz-verdict-chip.quiz-mismatch {
	background: var(--mismatch);
	color: #fff;
}

footer.quiz-foot {
	margin-top: 40px;
	padding: 20px 0 20px;
	border-top: 1px solid var(--line);
	color: var(--muted);
}
footer.quiz-foot a { color: var(--ink); }

.quiz-pic img {
	display: block;
	width: 100%;
	height: auto;
}

.quiz-pic {
	margin-bottom: 20px;
}

/* ---------- Адаптив ---------- */
@media (max-width: 720px) {

	body {
		font-size: 14px;
	}

	.quiz-btn {
		font-size: 16px;
		line-height: 1.2;
	}
	
	.quiz-page {
		padding: 0 20px 0 20px;
	}

	.quiz-topbar {
		padding-top: 16px;
		padding-bottom: 14px;
		margin-bottom: 30px;
	}

	.quiz-name {
		font-size: 14px;
	}

	.quiz-page h1, .quiz-page h2 {
		font-size: 28px;
	}

	.quiz-description {
		font-size: 16px;
	}

	.quiz-intro-meta {
		flex-direction: column;
		align-items: stretch;
		gap: 24px;
		border-bottom: 0;
		padding-bottom: 0;
	}

	.quiz-intro-meta-stats {
		width: 100%;
		border-bottom: 1px solid var(--line);
		padding-bottom: 16px;
	}

	.quiz-intro-meta .quiz-btn {
		align-self: center;
		min-width: 220px;
	}

	.quiz-intro-meta-stats .ttl {
		display: block;
	}

	.quiz-intro-meta-stats .sep {
		display: none;
	}

	.quiz-intro-meta-stats > div {
		flex-grow: 1;
	}

	.quiz-intro-meta-stats > div:nth-child(5) {
		flex: 0 0 150px;
	}

	.quiz-intro-meta-stats > div + div {
		border-left: 1px solid var(--line);
		padding-left: 11px;
	}

	.quiz-question {
		font-size: 24px;
	}

	.quiz-verdict {
		gap: 20px;
	}

	.quiz-verdict-pic img {
		width: 50px;
		height: 50px;
	}

	.quiz-verdict-header {
		flex-wrap: wrap;
	}

	.quiz-verdict-header div {
		flex: 0 0 100%;

	}

	.quiz-verdict-header div:nth-child(2) {
		display: none;
	}

	.quiz-stats {
		gap: 10px;
		line-height: 1.2;
	}

	.quiz-stats .quiz-n {
		font-size: 32px;
		margin-bottom: 8px;
	}

	.quiz-summary-row {
		gap: 16px;
		font-size: 16px;
	}

	.quiz-summary-row .quiz-verdict-chip {
		font-size: 16px;
		padding: 8px 10px;
	}

	.quiz-actions.quiz-actions-result {
		flex-direction: column;
		gap: 10px;
	}

	.quiz-scale-wrap {
    margin: 80px 0 65px;
	}

}
