@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500&display=swap');

.wdk-quiz {
	max-width: 640px;
	margin: 0 auto;
	font-family: 'Inter', sans-serif;
	background: radial-gradient(circle at 20% 0%, #F6F7FC 0%, #FFFFFF 55%);
	padding: 28px 24px 32px;
	border-radius: 20px;
}

/* ---------- Header ---------- */
.wdk-quiz-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}
.wdk-quiz-brand {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 700;
	font-size: 15px;
	color: #12172B;
}
.wdk-flame-icon { flex-shrink: 0; }

/* ---------- Timer ring (per-question, paginated only) ---------- */
.wdk-timer-ring {
	position: relative;
	width: 52px;
	height: 52px;
}
.wdk-timer-ring-progress {
	stroke-dasharray: 163.4;
	stroke-dashoffset: 0;
	transition: stroke-dashoffset 1s linear, stroke 0.3s;
}
.wdk-timer-ring.is-urgent .wdk-timer-ring-progress { stroke: #E4453B !important; }
.wdk-timer-ring-text {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: 'JetBrains Mono', monospace;
	font-size: 14px;
	font-weight: 500;
	color: #12172B;
}
.wdk-timer-ring.is-urgent .wdk-timer-ring-text { color: #E4453B; }

/* Legacy whole-quiz countdown (scroll layout / no per-question timer) */
.wdk-quiz-timer {
	background: #12172B;
	color: #fff;
	text-align: center;
	padding: 8px;
	border-radius: 8px;
	font-family: 'JetBrains Mono', monospace;
	font-weight: 500;
	margin-bottom: 16px;
}

/* ---------- Segmented progress (matches quiz/results/intro) ---------- */
.wdk-quiz-progress-seg {
	display: flex;
	gap: 6px;
	margin-bottom: 26px;
}
.wdk-seg {
	flex: 1;
	height: 6px;
	border-radius: 999px;
	background: #EEF0F8;
	overflow: hidden;
}
.wdk-seg-fill {
	height: 100%;
	width: 0%;
	background: #E8A23B;
	border-radius: 999px;
}
.wdk-seg.is-current .wdk-seg-fill { background: #E8A23B; transition: width 1s linear; }
.wdk-seg.is-correct .wdk-seg-fill { width: 100%; background: #12B8A6; transition: none; }
.wdk-seg.is-wrong .wdk-seg-fill { width: 100%; background: #F1594B; transition: none; }
.wdk-progress-preview { margin-bottom: 24px; }

/* Legacy scroll-layout progress bar (paginated uses wdk-quiz-progress-seg instead) */
.wdk-quiz-progress { margin-bottom: 16px; }
.wdk-progress-text {
	display: block;
	font-family: 'JetBrains Mono', monospace;
	font-size: 12px;
	color: #8891B8;
	margin-bottom: 6px;
	text-align: center;
}
.wdk-progress-bar {
	background: #EEF0F8;
	border-radius: 999px;
	height: 6px;
	overflow: hidden;
}
.wdk-progress-fill {
	background: #E8A23B;
	height: 100%;
	transition: width 0.25s ease;
}

/* ---------- Intro screen ---------- */
.wdk-quiz-intro {
	text-align: left;
}
.wdk-category-tag {
	display: inline-block;
	font-family: 'JetBrains Mono', monospace;
	font-size: 11px;
	letter-spacing: 0.08em;
	color: #0E9384;
	background: rgba(18,184,166,0.1);
	padding: 5px 11px;
	border-radius: 999px;
	margin-bottom: 16px;
}
.wdk-quiz-intro h2 {
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 700;
	font-size: 26px;
	line-height: 1.2;
	color: #12172B;
	margin: 0 0 12px;
}
.wdk-intro-desc {
	font-size: 14.5px;
	line-height: 1.55;
	color: #6B72A0;
	margin: 0 0 26px;
}
.wdk-intro-desc p { margin: 0 0 12px; }
.wdk-intro-meta {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin-bottom: 22px;
}
.wdk-meta-chip {
	background: #FFFFFF;
	border: 1px solid #EAEBF5;
	border-radius: 14px;
	padding: 14px 10px;
	text-align: center;
}
.wdk-meta-value {
	display: block;
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 700;
	font-size: 16px;
	color: #12172B;
}
.wdk-meta-label {
	display: block;
	font-family: 'JetBrains Mono', monospace;
	font-size: 10px;
	letter-spacing: 0.05em;
	color: #8891B8;
	margin-top: 2px;
	text-transform: uppercase;
}
.wdk-start-quiz {
	width: 100%;
	margin-top: 6px;
	padding: 15px 24px !important;
	font-family: 'Space Grotesk', sans-serif !important;
	font-weight: 700 !important;
	font-size: 15px !important;
	color: #12172B !important;
	background: #E8A23B !important;
	border: none !important;
	border-radius: 12px !important;
}

/* ---------- Fun-fact / explanation panel (intro teaser + per-question) ---------- */
.wdk-fact-teaser,
.wdk-question-fact {
	display: flex;
	gap: 10px;
	background: #FFF8EB;
	border: 1px solid #F5E3BF;
	border-radius: 12px;
	padding: 13px 15px;
	margin-bottom: 18px;
}
.wdk-lightbulb-icon { flex-shrink: 0; margin-top: 1px; }
.wdk-fact-teaser-text,
.wdk-question-fact p {
	font-size: 13px;
	line-height: 1.5;
	color: #6B5A2E;
	margin: 0;
}

/* ---------- Question card ---------- */
.wdk-question {
	background: #FFFFFF;
	border: 1px solid #EAEBF5;
	box-shadow: 0 12px 32px -12px rgba(30,38,90,0.12);
	border-radius: 20px;
	padding: 30px 26px;
	margin-bottom: 16px;
	position: relative;
	overflow: hidden;
}
.wdk-quiz[data-layout="paginated"] .wdk-question:not(:first-child) {
	display: none;
}
.wdk-question-eyebrow {
	font-family: 'JetBrains Mono', monospace;
	color: #8891B8;
	font-size: 12px;
	letter-spacing: 0.06em;
	margin-bottom: 14px;
}
.wdk-question-ghost-num {
	position: absolute;
	top: -6px;
	right: 16px;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 72px;
	font-weight: 700;
	color: #F1F2FA;
	line-height: 1;
	user-select: none;
	z-index: 0;
}
.wdk-question-title {
	font-family: 'Space Grotesk', sans-serif;
	color: #12172B;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0 0 20px;
	position: relative;
	z-index: 1;
	max-width: 92%;
}
.wdk-question-number { margin-right: 4px; }
.wdk-question-image {
	width: 100%;
	max-height: 220px;
	border-radius: 14px;
	overflow: hidden;
	margin-bottom: 18px;
	background: linear-gradient(160deg, #F6F7FC, #EEF0F8);
	display: flex;
	align-items: center;
	justify-content: center;
}
.wdk-question-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---------- Answer options ---------- */
.wdk-answers {
	display: flex;
	flex-direction: column;
	gap: 10px;
	position: relative;
	z-index: 1;
}
.wdk-answer {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 13px 15px;
	border-radius: 12px;
	border: 1.5px solid #E3E6F2;
	background: #FAFBFE;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s;
}
.wdk-answer:hover { border-color: #D8DCF0; }
.wdk-answer input[type="radio"],
.wdk-answer input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}
.wdk-answer-badge {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 8px;
	background: #EEF0F8;
	color: #6B72A0;
	font-family: 'JetBrains Mono', monospace;
	font-size: 12px;
	font-weight: 600;
	flex-shrink: 0;
}
.wdk-answer-text {
	font-family: 'Inter', sans-serif;
	font-size: 14.5px;
	font-weight: 500;
	color: #333A5C;
}

/* Reveal states, applied via JS after an answer is locked in */
.wdk-answer.is-correct-answer {
	border-color: #12B8A6;
	background: rgba(18,184,166,0.08);
}
.wdk-answer.is-correct-answer .wdk-answer-badge { background: #12B8A6; color: #fff; }
.wdk-answer.is-wrong-selected {
	border-color: #F1594B;
	background: rgba(241,89,75,0.08);
}
.wdk-answer.is-wrong-selected .wdk-answer-badge { background: #F1594B; color: #fff; }
.wdk-answer.is-dimmed .wdk-answer-text { color: #A6ACC9; }
.wdk-quiz.is-locked .wdk-answer { cursor: default; }

/* True/False gets the two-big-card treatment via a modifier class */
.wdk-question[data-type="true_false"] .wdk-answers {
	flex-direction: row;
	gap: 12px;
}
.wdk-question[data-type="true_false"] .wdk-answer {
	flex: 1;
	flex-direction: column;
	gap: 8px;
	padding: 22px 14px;
	text-align: center;
}
.wdk-question[data-type="true_false"] .wdk-answer-badge {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	font-size: 14px;
}

/* Fill in the blank */
.wdk-fill-blank-input {
	width: 100%;
	font-family: 'Inter', sans-serif;
	font-size: 15px;
	color: #12172B;
	background: #FAFBFE;
	border: 1.5px solid #E3E6F2;
	border-radius: 12px;
	padding: 13px 16px;
	margin-bottom: 12px;
	box-sizing: border-box;
}
.wdk-fill-blank-input:focus { outline: none; border-color: #E8A23B; }
.wdk-fill-blank-input.is-correct { border-color: #12B8A6; color: #0E9384; }
.wdk-fill-blank-input.is-wrong { border-color: #F1594B; color: #C6402F; }
.wdk-fill-blank-submit {
	font-family: 'Space Grotesk', sans-serif !important;
	font-weight: 700 !important;
	font-size: 14px !important;
	color: #12172B !important;
	background: #E8A23B !important;
	border: none !important;
	border-radius: 10px !important;
	padding: 12px 20px !important;
}
.wdk-fill-blank-submit:disabled { opacity: 0.5; cursor: default; }

/* Per-question feedback line + fact panel, revealed via JS */
.wdk-question-feedback {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 15px;
	border-radius: 12px;
	margin-top: 14px;
	font-size: 14px;
	font-weight: 500;
}
.wdk-question-feedback.is-correct { background: rgba(18,184,166,0.08); color: #0E9384; border: 1.5px solid #12B8A6; }
.wdk-question-feedback.is-wrong { background: rgba(241,89,75,0.08); color: #C6402F; border: 1.5px solid #F1594B; }
.wdk-question-fact { margin-top: 14px; margin-bottom: 0; }

/* ---------- Nav / submitter ---------- */
.wdk-quiz-nav {
	display: flex;
	justify-content: space-between;
	margin-top: 4px;
}
.wdk-quiz-nav button {
	font-family: 'Space Grotesk', sans-serif !important;
	font-weight: 700 !important;
	font-size: 14px !important;
	border-radius: 10px !important;
	padding: 12px 22px !important;
	border: none !important;
}
.wdk-prev-question { background: #EEF0F8 !important; color: #12172B !important; }
.wdk-prev-question:disabled { opacity: 0.4; cursor: not-allowed; }
.wdk-next-question { background: #E8A23B !important; color: #12172B !important; margin-left: auto; }
.wdk-next-question:disabled { background: #EEF0F8 !important; color: #B9BEDE !important; cursor: default; }

.wdk-quiz-submitter {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 20px;
}
.wdk-quiz-submitter input[type="text"],
.wdk-quiz-submitter input[type="email"] {
	flex: 1;
	min-width: 180px;
	font-family: 'Inter', sans-serif;
	border: 1.5px solid #E3E6F2;
	border-radius: 10px;
	padding: 11px 14px;
}
.wdk-submit-quiz {
	width: 100%;
	font-family: 'Space Grotesk', sans-serif !important;
	font-weight: 700 !important;
	font-size: 15px !important;
	color: #12172B !important;
	background: #E8A23B !important;
	border: none !important;
	border-radius: 12px !important;
	padding: 14px !important;
}

/* ---------- Results screen ---------- */
.wdk-quiz-result {
	text-align: center;
	padding: 8px 4px 4px;
	position: relative;
}
.wdk-results-eyebrow {
	font-family: 'JetBrains Mono', monospace;
	font-size: 12px;
	letter-spacing: 0.06em;
	color: #8891B8;
}
.wdk-score-ring-wrap {
	position: relative;
	width: 148px;
	height: 148px;
	margin: 10px auto 4px;
}
.wdk-score-ring-progress {
	stroke-dasharray: 402.1;
	stroke-dashoffset: 402.1;
	transition: stroke-dashoffset 1.1s cubic-bezier(.2,.8,.2,1);
}
.wdk-score-ring-label {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}
.wdk-score-fraction {
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 700;
	font-size: 32px;
	color: #12172B;
	line-height: 1;
}
.wdk-score-pct {
	font-family: 'JetBrains Mono', monospace;
	font-size: 12px;
	color: #8891B8;
	margin-top: 4px;
}
.wdk-result-headline {
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 700;
	font-size: 22px;
	color: #12172B;
	margin: 14px 0 6px;
}
.wdk-result-sub {
	font-size: 14px;
	color: #6B72A0;
	max-width: 340px;
	margin: 0 auto 22px;
}
.wdk-quiz-outro { margin: 0 0 22px; color: #444; text-align: left; }

.wdk-recap-list {
	text-align: left;
	background: #FFFFFF;
	border: 1px solid #EAEBF5;
	border-radius: 16px;
	overflow: hidden;
	margin-bottom: 24px;
}
.wdk-recap-item {
	padding: 14px 16px;
	border-bottom: 1px solid #F1F2F8;
}
.wdk-recap-item:last-child { border-bottom: none; }
.wdk-recap-question {
	font-size: 13.5px;
	color: #333A5C;
	line-height: 1.4;
	margin: 0 0 8px;
}
.wdk-recap-num {
	font-family: 'JetBrains Mono', monospace;
	color: #A6ACC9;
	font-size: 12px;
	margin-right: 4px;
}
.wdk-recap-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.wdk-recap-tag {
	font-family: 'JetBrains Mono', monospace;
	font-size: 11px;
	padding: 3px 8px;
	border-radius: 6px;
}
.wdk-recap-tag.is-correct { background: rgba(18,184,166,0.1); color: #0E9384; }
.wdk-recap-tag.is-wrong { background: rgba(241,89,75,0.1); color: #C6402F; }

.wdk-share-buttons {
	display: flex;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 4px;
}
.wdk-share-buttons a {
	padding: 10px 18px;
	border-radius: 999px;
	background: #EEF0F8;
	color: #12172B;
	text-decoration: none;
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 700;
	font-size: 13px;
}
.wdk-retake-link { margin-top: 16px; }
.wdk-retake-link a { color: #E8A23B; font-weight: 600; text-decoration: none; }

/* ---------- Ribbon burst (JS injects .wdk-ribbon spans on results mount) ---------- */
.wdk-ribbon-burst {
	position: fixed;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
	z-index: 999;
}
.wdk-ribbon {
	position: absolute;
	top: -8%;
	border-radius: 2px;
	will-change: transform, opacity;
}
@keyframes wdkRibbonRain {
	0% { transform: translate(0,0) rotate(0deg) scaleX(1); opacity: 1; }
	20% { transform: translate(calc(var(--sway) * 0.4), 22vh) rotate(calc(var(--rot) * 0.2)) scaleX(0.9); opacity: 1; }
	45% { transform: translate(calc(var(--sway) * -0.6), 48vh) rotate(calc(var(--rot) * 0.48)) scaleX(0.2); opacity: 1; }
	70% { transform: translate(calc(var(--sway) * 0.8), 72vh) rotate(calc(var(--rot) * 0.75)) scaleX(0.9); opacity: 0.75; }
	100% { transform: translate(calc(var(--sway) * -0.3), 100vh) rotate(var(--rot)) scaleX(0.5); opacity: 0; }
}
@keyframes wdkConfettiRain {
	0% { transform: translate(0,0) rotate(0deg); opacity: 1; }
	25% { transform: translate(calc(var(--sway) * 0.5), 26vh) rotate(calc(var(--rot) * 0.3)); opacity: 1; }
	55% { transform: translate(calc(var(--sway) * -0.5), 54vh) rotate(calc(var(--rot) * 0.6)); opacity: 0.9; }
	100% { transform: translate(calc(var(--sway) * 0.6), 100vh) rotate(var(--rot)); opacity: 0; }
}

/* ---------- Leaderboard ---------- */
.wdk-leaderboard {
	width: 100%;
	border-collapse: collapse;
	font-family: 'Inter', sans-serif;
}
.wdk-leaderboard th,
.wdk-leaderboard td {
	padding: 10px 12px;
	border-bottom: 1px solid #EAEBF5;
	text-align: left;
}
.wdk-leaderboard th {
	font-family: 'JetBrains Mono', monospace;
	font-size: 11px;
	letter-spacing: 0.05em;
	color: #8891B8;
	text-transform: uppercase;
}
.wdk-leaderboard tr:first-child td {
	font-weight: 700;
	color: #E8A23B;
}

/* ================= Mobile responsiveness ================= */
@media ( max-width: 480px ) {
	.wdk-quiz {
		padding: 20px 16px 24px;
		border-radius: 14px;
	}

	/* Intro meta chips: 3-up feels cramped on a phone — wrap the third one down */
	.wdk-intro-meta {
		grid-template-columns: repeat( 2, 1fr );
	}
	.wdk-intro-meta .wdk-meta-chip:first-child {
		grid-column: 1 / -1;
	}
	.wdk-meta-value { font-size: 15px; }
	.wdk-quiz-intro h2 { font-size: 22px; }

	/* Question card: less padding, smaller ghost numeral so it doesn't crowd the text */
	.wdk-question {
		padding: 22px 18px;
		border-radius: 16px;
	}
	.wdk-question-ghost-num {
		font-size: 46px;
		top: -2px;
		right: 12px;
	}
	.wdk-question-title {
		font-size: 17px;
		max-width: 82%;
	}
	.wdk-question-eyebrow { font-size: 11px; }

	/* Answers: tighten padding, keep the badge but shrink slightly */
	.wdk-answer {
		padding: 11px 12px;
		gap: 11px;
	}
	.wdk-answer-badge {
		width: 22px;
		height: 22px;
		font-size: 11px;
	}
	.wdk-answer-text { font-size: 13.5px; }

	/* True/False cards: keep side-by-side but tighten so both fit comfortably */
	.wdk-question[data-type="true_false"] .wdk-answer {
		padding: 16px 10px;
	}
	.wdk-question[data-type="true_false"] .wdk-answer-badge {
		width: 26px;
		height: 26px;
	}

	.wdk-question-image { max-height: 160px; }

	/* Header + timer ring: shrink slightly so brand text doesn't wrap awkwardly */
	.wdk-quiz-brand { font-size: 13.5px; }
	.wdk-timer-ring, .wdk-timer-ring svg { width: 44px; height: 44px; }
	.wdk-timer-ring-text { font-size: 12px; }

	/* Nav buttons: full-width stacking instead of squeezing side by side */
	.wdk-quiz-nav {
		flex-direction: column-reverse;
		gap: 10px;
	}
	.wdk-quiz-nav button { width: 100%; }

	/* Results screen: smaller ring so it doesn't dominate a small viewport */
	.wdk-score-ring-wrap { width: 120px; height: 120px; }
	.wdk-score-ring-wrap svg { width: 120px; height: 120px; }
	.wdk-score-fraction { font-size: 26px; }
	.wdk-result-headline { font-size: 19px; }
	.wdk-result-sub { font-size: 13px; }

	.wdk-share-buttons a { padding: 9px 14px; font-size: 12px; }

	.wdk-recap-question { font-size: 13px; }
	.wdk-recap-tag { font-size: 10px; }
}

@media ( max-width: 340px ) {
	/* Smallest phones: True/False stacks vertically rather than squeezing */
	.wdk-question[data-type="true_false"] .wdk-answers {
		flex-direction: column;
	}
}
