/* Almofiid quiz layer. Scoped to .aq so it cannot lock the host theme's styles. */
/* The player hides panels with the hidden attribute, and an author display rule beats the
   browser's [hidden] rule at any specificity — without this the finished board stays on screen. */
.aq [hidden] { display: none !important; }
.aq {
	--aq-ink: #17201f;
	--aq-mute: #5b6765;
	--aq-line: #dfe4e2;
	--aq-card: #fff;
	--aq-bg: #f5f7f6;
	--aq-brand: #b60202;
	--aq-brand-soft: #fdf1f1;
	--aq-right: #0b7a3e;
	--aq-right-soft: #eef8f1;
	--aq-wrong: #b3261e;
	--aq-wrong-soft: #fdeeec;
	/* #b26a00 measured 4.16:1 on the paper bank, so the amber had to come down to clear AA */
	--aq-gold: #8a5300;
	--aq-navy: #061426;
	--aq-surface: #0c223b;
	--aq-raised: #142f4d;
	--aq-blue: #36a8f7;
	--aq-gold-hi: #ffe6a3;
	--aq-success: #57d9a4;
	--aq-danger: #ff8e91;
	max-width: 1120px;
	margin: 0 auto;
	color: var(--aq-ink);
	line-height: 1.85;
	font-variant-numeric: lining-nums;
}
.aq *, .aq *::before, .aq *::after { box-sizing: border-box; }
.aq h2 { margin: 0 0 .5em; font-size: 1.42rem; line-height: 1.5; }
.aq h3 { margin: 1.2em 0 .45em; font-size: 1.1rem; }
.aq p { margin: 0 0 .9em; }
.aq ol, .aq ul { margin: 0 0 1em; padding: 0; list-style: none; }
.aq-lead { font-size: 1.06rem; color: #2a3634; }
.aq-quiet { color: var(--aq-mute); font-size: .88rem; }
.aq-sub { font-size: 1rem; margin: 1.4em 0 .5em; }
.aq-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.aq-panel, .aq-bank, .aq-guide {
	background: var(--aq-card);
	border: 1px solid var(--aq-line);
	border-radius: 16px;
	padding: 20px 18px;
	margin: 0 0 18px;
}
.aq-intro { border-top: 4px solid var(--aq-brand); }

.aq-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
#almofiid-quiz .aq-facts > li { list-style: none; }
.aq-facts li {
	background: var(--aq-bg);
	border: 1px solid var(--aq-line);
	border-radius: 999px;
	padding: 4px 12px;
	font-size: .84rem;
	color: #33413f;
}
.aq-note {
	background: var(--aq-brand-soft);
	border: 1px solid #f0d3d3;
	border-radius: 12px;
	padding: 12px 14px;
	margin: 14px 0;
	font-size: .92rem;
	color: #6d2020;
}
.aq-row { margin: 16px 0 6px; }

/* buttons */
.aq-btn {
	appearance: none;
	border: 1px solid var(--aq-brand);
	background: var(--aq-brand);
	color: #fff;
	border-radius: 11px;
	padding: 11px 20px;
	min-height: 44px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.aq-btn:hover:not(:disabled) { background: #95080a; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(182, 2, 2, .18); }
.aq-btn:disabled { opacity: .55; cursor: not-allowed; }
.aq-btn[aria-busy="true"], .aq-btn.is-loading { cursor: progress; opacity: .72; }
.aq-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.aq-btn:focus-visible { outline: 3px solid #7ab8ff; outline-offset: 3px; }
.aq-btn:not(.aq-primary) { background: #fff; color: var(--aq-ink); border-color: var(--aq-line); }
.aq-btn:not(.aq-primary):hover:not(:disabled) { background: var(--aq-bg); box-shadow: none; color: var(--aq-ink); }
.aq-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 16px; }
.aq-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	background: #fff;
	border: 1px solid var(--aq-line);
	border-radius: 999px;
	padding: 8px 16px;
	font: inherit;
	font-size: .86rem;
	color: #2a3634;
	cursor: pointer;
	text-decoration: none;
}
.aq-chip:hover { background: var(--aq-bg); }
.aq-chip:active { transform: translateY(1px); }
.aq-share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; font-size: .9rem; color: var(--aq-mute); }

/* play */
.aq-topic {
	display: inline-block;
	background: var(--aq-bg);
	border: 1px solid var(--aq-line);
	color: var(--aq-gold);
	border-radius: 8px;
	padding: 2px 10px;
	font-size: .82rem;
	font-weight: 700;
	margin: 0 0 10px;
}
.aq-field { border: 0; padding: 0; margin: 0 0 6px; min-inline-size: 0; }
.aq-field legend { font-size: 1.14rem; font-weight: 700; line-height: 1.7; padding: 0; margin-bottom: 12px; }
.aq-field legend:focus-visible { outline: 3px solid #7ab8ff; outline-offset: 4px; border-radius: 6px; }
.aq-options { display: grid; gap: 9px; }
/* .aq-opt is also the bank's answer-list item, which must stay a plain line of text, so the
   card styling is scoped to the board container rather than to the class. */
.aq-options .aq-opt {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	border: 1.5px solid var(--aq-line);
	background: #fff;
	border-radius: 12px;
	padding: 12px 14px;
	min-height: 52px;
	cursor: pointer;
	font-size: 1rem;
	transition: border-color .12s ease, background .12s ease;
}
.aq-options .aq-opt:hover { border-color: #b9c4c1; background: #fbfcfb; }
.aq-options .aq-opt input { margin: 5px 0 0; flex: 0 0 auto; accent-color: var(--aq-brand); }
.aq-options .aq-opt:has(input:checked) { border-color: var(--aq-brand); background: var(--aq-brand-soft); }
.aq-options .aq-opt:has(input:focus-visible) { outline: 3px solid #7ab8ff; outline-offset: 2px; }
.aq-error { color: var(--aq-wrong); font-weight: 700; margin-top: 10px; }

/* result */
.aq-score { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 12px; }
.aq-score strong { font-size: 2.6rem; line-height: 1; color: var(--aq-brand); }
.aq-score span { color: var(--aq-mute); font-size: .95rem; }
.aq-meter { height: 12px; border-radius: 999px; background: #e8ecea; overflow: hidden; margin-bottom: 14px; }
.aq-meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--aq-brand), #e06a1f 45%, var(--aq-right)); transition: width .5s ease; }
.aq-tally { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); list-style: none; margin: 0; padding: 0; }
.aq-tally li { background: var(--aq-bg); border: 1px solid var(--aq-line); border-radius: 10px; padding: 8px 12px; font-size: .9rem; text-wrap: balance; }
.aq-recap { margin-top: 14px; }
.aq-recap summary, .aq-explain summary, .aq-guide summary, .aq-topic-bank summary { cursor: pointer; font-weight: 700; }
/* every recap row already carries its own number in the text, so the ol markers are dropped */
.aq-recap ol { margin-top: 12px; display: grid; gap: 10px; list-style: none; margin-inline-start: 0; padding-inline-start: 0; }
.aq-recap li { border: 1px solid var(--aq-line); border-inline-start: 4px solid var(--aq-line); border-radius: 10px; padding: 10px 14px; font-size: .92rem; }
.aq-recap li.good { border-inline-start-color: var(--aq-right); background: #fbfefc; }
.aq-recap li.bad { border-inline-start-color: var(--aq-wrong); background: #fffcfb; }
.aq-recap p { margin: 0 0 .25em; }
.aq-recap p:first-child { font-weight: 700; }
.aq-whyline { color: var(--aq-mute); font-size: .86rem; }

/* bank */
.aq-bank h2 + p { color: #33413f; }
.aq-topic-bank { border: 1px solid var(--aq-line); border-radius: 12px; padding: 0 14px; margin-bottom: 10px; background: #fcfdfd; }
.aq-topic-bank > summary { padding: 12px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; list-style: none; }
.aq-topic-bank > summary::-webkit-details-marker { display: none; }
.aq-topic-bank > summary::before { content: "▸"; color: var(--aq-brand); font-size: 1rem; }
.aq-topic-bank[open] > summary::before { content: "▾"; }
.aq-topic-h { display: inline; margin: 0; font-size: 1.02rem; }
.aq-topic-bank summary span { color: var(--aq-mute); font-size: .82rem; font-weight: 400; }
.aq-qs { counter-reset: aq; margin: 0; padding: 0 0 14px; }
.aq-qs > li { border-top: 1px dashed var(--aq-line); padding: 12px 0; }
.aq-stem { font-weight: 700; margin: 0 0 8px; }
/* only the printed bank numbers itself by counter; the review writes its own numbers in the player */
.aq-qs .aq-stem::before { counter-increment: aq; content: counter(aq) ". "; color: var(--aq-mute); font-weight: 400; }
.aq-opts { display: grid; gap: 4px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.aq-opts li { color: #3d4a48; font-size: .94rem; }
.aq-opts li.is-right { color: var(--aq-right); font-weight: 700; }
.aq-tick { color: var(--aq-right); }
.aq-explain { margin: 8px 0 0; }
.aq-explain summary { font-size: .86rem; color: var(--aq-gold); font-weight: 600; }
.aq-explain p { margin: 6px 0 0; font-size: .9rem; color: #3d4a48; }
/* a topic opens on its first rows; the rest arrive when the reader asks. The row is a list item, so it
   must not borrow the dashed rule that separates questions. */
.aq-qs > li.aq-more { border-top: 0; padding: 2px 0 0; }
.aq-more-btn { font: inherit; }
/* the topics index: a name that jumps, a count, and one line on what the topic actually holds */
.aq-topics-list { display: grid; gap: 12px; margin: 0; }
.aq-topics-list dt { font-weight: 700; }
.aq-topics-list dt a { display: flex; align-items: baseline; gap: 8px; color: inherit; text-decoration: none; }
.aq-topics-list dt a:hover { color: var(--aq-brand); text-decoration: underline; }
.aq-topics-list dt span { color: var(--aq-mute); font-size: .82rem; font-weight: 400; }
.aq-topics-list dd { margin: 0; color: #3d4a48; font-size: .92rem; }

.aq-guide details { border: 1px solid var(--aq-line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.aq-guide details p { margin: 8px 0 0; }

/* 800 questions is a lot of DOM: skip layout and paint for the rows nobody is looking at yet */
.aq-qs > li { content-visibility: auto; contain-intrinsic-size: auto 128px; }

/* ── the studio board ──────────────────────────────────────────────────────
   The game is a quiz show, so the stage goes dark and gold while the reference
   bank below stays paper-white. Every rule below reuses the tokens above, which
   is why the buttons, notes and chips recolour without being touched.        */
.aq-millionaire .aq-intro,
.aq-millionaire #aq-play,
.aq-millionaire #aq-level-result,
.aq-millionaire #aq-result {
	--aq-ink: #f6f8fd;
	--aq-mute: #c7d4e4;
	--aq-line: rgba(246, 198, 94, .3);
	--aq-card: #0c223b;
	--aq-bg: #142f4d;
	--aq-brand: #f6c65e;
	--aq-brand-soft: #3a301d;
	--aq-right: #57d9a4;
	--aq-right-soft: #10352a;
	--aq-wrong: #ff8e91;
	--aq-wrong-soft: #431f2a;
	--aq-gold: #f6c65e;
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background: radial-gradient(100% 90% at 50% -15%, rgba(54, 168, 247, .22), transparent 58%), linear-gradient(145deg, #142f4d 0%, #0c223b 48%, #061426 100%);
	border: 1px solid rgba(246, 198, 94, .28);
	border-radius: 22px;
	color: var(--aq-ink);
	box-shadow: 0 24px 60px rgba(2, 8, 20, .46), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.aq-millionaire :is(.aq-intro, #aq-play, #aq-level-result, #aq-result)::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: linear-gradient(112deg, transparent 24%, rgba(54, 168, 247, .055) 24.5%, transparent 42%), linear-gradient(68deg, transparent 56%, rgba(54, 168, 247, .045) 56.5%, transparent 73%);
}
.aq-hero { display: grid; grid-template-columns: 148px minmax(0, 1fr); align-items: center; gap: 24px; }
.aq-hero-copy { min-width: 0; }
.aq-hero h2 { margin: 0 0 12px; font-size: clamp(1.75rem, 4vw, 2.7rem); line-height: 1.3; letter-spacing: -.02em; }
#almofiid-quiz .aq-kicker { margin: 0 0 7px; color: var(--aq-gold-hi); font-size: .82rem; font-weight: 800; letter-spacing: .025em; }
.aq-trophy { width: 142px; aspect-ratio: 1; display: grid; place-items: center; margin: 0 auto; border-radius: 50%; background: radial-gradient(circle, rgba(246, 198, 94, .17), rgba(54, 168, 247, .06) 54%, transparent 72%); filter: drop-shadow(0 12px 24px rgba(246, 198, 94, .14)); }
.aq-trophy svg { width: 82%; height: 82%; overflow: visible; fill: rgba(246, 198, 94, .14); stroke: #f6c65e; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.aq-trophy .aq-trophy-star { fill: #ffe6a3; stroke: #ffe6a3; }
.aq-trophy-small { width: 88px; margin-bottom: 8px; }
#almofiid-quiz .aq-privacy-note { margin: 12px 0; padding-inline-start: 12px; border-inline-start: 3px solid var(--aq-blue); color: var(--aq-mute); font-size: .88rem; }
/* the lead line sits on the dark stage; the bank paragraph sits on paper and keeps its own ink */
.aq-millionaire .aq-lead { color: #dfe7ef; }
.aq-millionaire .aq-facts li { background: rgba(255, 255, 255, .05); border-color: rgba(246, 198, 94, .25); color: #e6ecf2; }
.aq-millionaire .aq-note { background: rgba(246, 198, 94, .1); border-color: rgba(246, 198, 94, .35); color: #f2e2b8; }
.aq-millionaire #aq-result .aq-chip { background: rgba(255, 255, 255, .06); border-color: rgba(246, 198, 94, .3); color: var(--aq-ink); }
.aq-millionaire #aq-result .aq-chip:hover { background: rgba(246, 198, 94, .18); }
.aq-timer-toggle { margin: 14px 0 4px; font-size: .92rem; }
.aq-timer-toggle label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--aq-mute); }
.aq-timer-toggle input { width: 18px; height: 18px; accent-color: var(--aq-brand); }

/* buttons on the board: gold plate, ink text */
.aq-millionaire .aq-btn {
	background: linear-gradient(180deg, #f2d692, #d9ac4f);
	border-color: #f2d692;
	color: #16100a;
	text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}
.aq-millionaire .aq-btn:hover:not(:disabled) { background: linear-gradient(180deg, #ffe6ad, #e0b658); box-shadow: 0 8px 22px rgba(246, 198, 94, .3); }
.aq-millionaire .aq-btn:not(.aq-primary) { background: rgba(255, 255, 255, .06); border-color: rgba(246, 198, 94, .35); color: var(--aq-ink); text-shadow: none; }
.aq-millionaire .aq-btn:not(.aq-primary):hover:not(:disabled) { background: rgba(246, 198, 94, .16); color: var(--aq-ink); }

/* The two reading cards between the board and the bank stay on paper. The rules above were written for
   midnight with literal pale colours, and a pale lead or pill on white is invisible — so for the classes
   they touch, put the paper values back. */
.aq-millionaire .aq-reading .aq-lead { color: #2a3634; }
.aq-millionaire .aq-reading .aq-facts li { background: var(--aq-bg); border-color: var(--aq-line); color: #2a3634; }

/* the board itself: stage next to the money tree */
.aq-board { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 20px; align-items: start; padding: 20px 18px; border-radius: 18px; }
.aq-hud { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.aq-level { margin: 0; display: flex; align-items: baseline; gap: 8px; font-size: .86rem; color: var(--aq-mute); }
.aq-level strong { font-size: 1.5rem; color: var(--aq-brand); line-height: 1; }
.aq-level-v { font-size: .95rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.aq-count { margin: 0; font-size: .86rem; color: var(--aq-mute); }
.aq-clock {
	margin: 0;
	min-width: 92px;
	text-align: center;
	border: 1.5px solid rgba(246, 198, 94, .45);
	border-radius: 999px;
	padding: 4px 14px;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	background: rgba(255, 255, 255, .05);
}
.aq-clock.urgent { border-color: #ff7a70; color: #ffc4bf; background: rgba(255, 90, 80, .16); animation: aq-beat .9s ease-in-out infinite; }
@keyframes aq-beat { 50% { transform: scale(1.06); } }

.aq-lifelines { display: flex; flex-wrap: wrap; gap: 8px; }
.aq-life {
	appearance: none;
	height: 40px;
	min-height: 44px;
	border-radius: 999px;
	border: 2px solid rgba(246, 198, 94, .55);
	background: radial-gradient(circle at 32% 28%, #1c3c5e, #0b1a2c 70%);
	color: #fff;
	font: inherit;
	font-size: .74rem;
	font-weight: 700;
	line-height: 1.25;
	cursor: pointer;
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 0 12px;
	white-space: nowrap;
	transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.aq-life > span { display: inline; font-size: .95rem; }
.aq-life:hover:not(:disabled) { transform: translateY(-2px); border-color: #f2d692; box-shadow: 0 8px 20px rgba(246, 198, 94, .28); }
.aq-life:focus-visible { outline: 3px solid #7ab8ff; outline-offset: 3px; }
.aq-life:disabled { cursor: not-allowed; opacity: .4; border-color: rgba(255, 255, 255, .22); }
.aq-life:disabled::after { content: ""; position: absolute; top: 50%; right: 7px; left: 7px; height: 2px; background: #ff7a70; }

/* answer plates */
.aq-millionaire .aq-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.aq-millionaire .aq-options .aq-opt {
	position: relative;
	background: linear-gradient(180deg, #142f4d, #0c223b);
	border: 1.5px solid rgba(199, 212, 228, .28);
	color: var(--aq-ink);
	padding: 14px 16px;
	min-height: 56px;
}
.aq-millionaire .aq-options .aq-opt .aq-plate {
	flex: 0 0 auto;
	align-self: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: rgba(246, 198, 94, .18);
	color: var(--aq-brand);
	font-size: .74rem;
	font-weight: 800;
	display: grid;
	place-items: center;
	margin-inline-start: auto;
}
.aq-millionaire .aq-options .aq-opt:hover { border-color: #36a8f7; background: linear-gradient(180deg, #193b60, #102a47); }
.aq-millionaire .aq-options .aq-opt:has(input:checked) { border-color: #36a8f7; background: linear-gradient(180deg, #19466f, #123453); box-shadow: inset 0 0 0 1px rgba(54, 168, 247, .55); }
.aq-millionaire .aq-options .aq-opt:has(input:checked) .aq-plate { background: #36a8f7; color: #061426; }
.aq-millionaire .aq-options .aq-opt.is-out { opacity: .3; text-decoration: line-through; pointer-events: none; }

/* the lock-in question */
.aq-confirm { border: 1.5px dashed rgba(246, 198, 94, .6); border-radius: 14px; padding: 14px; margin-top: 14px; background: rgba(246, 198, 94, .07); }
.aq-confirm-q { margin: 0 0 4px; font-weight: 700; color: #f6e6bf; }

/* the money tree */
.aq-ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.aq-rung {
	--aq-notch: 13px;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 5px 14px;
	clip-path: polygon(var(--aq-notch) 0, calc(100% - var(--aq-notch)) 0, 100% 50%, calc(100% - var(--aq-notch)) 100%, var(--aq-notch) 100%, 0 50%);
	background: linear-gradient(180deg, rgba(246, 198, 94, .5), rgba(246, 198, 94, .16));
	font-size: .78rem;
}
.aq-rung::before {
	content: "";
	position: absolute;
	inset: 1.5px;
	clip-path: polygon(var(--aq-notch) 0, calc(100% - var(--aq-notch)) 0, 100% 50%, calc(100% - var(--aq-notch)) 100%, var(--aq-notch) 100%, 0 50%);
	background: linear-gradient(180deg, #14293f, #0c1a2a);
}
.aq-rung b, .aq-rung span { position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.aq-rung b { font-size: .84rem; font-weight: 700; color: #e9eef4; }
.aq-rung span { color: var(--aq-mute); font-size: .7rem; }
.aq-rung.is-past { background: linear-gradient(180deg, rgba(87, 217, 164, .34), rgba(87, 217, 164, .1)); }
.aq-rung.is-past::before { background: #0c1a2a; }
.aq-rung.is-past b { color: #7fd8ac; }
.aq-rung.is-now { background: linear-gradient(180deg, #ffe6ad, #d9a53f); animation: aq-climb 1.4s ease-in-out infinite; }
.aq-rung.is-now::before { background: linear-gradient(180deg, #4a3a12, #2b2109); }
.aq-rung.is-now b { color: #ffe9b8; font-size: .92rem; }
.aq-rung.is-now span { color: #f6c65e; }
.aq-rung.aq-top b { color: #fff3d0; }
.aq-rung.aq-top.is-now::before { background: linear-gradient(180deg, #6b5318, #3a2c0a); }
@keyframes aq-climb { 50% { filter: brightness(1.22); } }

/* the payoff */
.aq-points { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 2px; }
.aq-points strong { font-size: clamp(2.4rem, 10vw, 4rem); line-height: 1; font-variant-numeric: tabular-nums; color: #f6c65e; }
@supports (background-clip: text) or (-webkit-background-clip: text) {
	.aq-points strong { background: linear-gradient(180deg, #fff0c4, #d9a53f); -webkit-background-clip: text; background-clip: text; color: transparent; }
}
.aq-points span { color: var(--aq-mute); font-size: 1rem; }
.aq-millionaire .aq-meter { background: rgba(255, 255, 255, .08); }
.aq-millionaire .aq-meter span { background: linear-gradient(90deg, #6b5318, #f6c65e 60%, #fff0c4); }
.aq-millionaire .aq-tally li { background: rgba(255, 255, 255, .05); color: #e6ecf2; }
.aq-millionaire .aq-recap li.good { background: rgba(87, 217, 164, .08); border-inline-start-color: var(--aq-right); }
.aq-millionaire .aq-recap li.bad { background: rgba(255, 142, 145, .07); border-inline-start-color: var(--aq-wrong); }
.aq-millionaire .aq-recap li > p:nth-child(3) { color: var(--aq-right); font-size: .88rem; }
.aq-millionaire .aq-whyline { color: var(--aq-mute); }

/* ── the level gate, the live correction and the save ───────────────────────
   These are the surfaces the 50%-per-level rule added: a scoreboard strip above the
   question, a verdict plate under it, a per-level result card and two dialogs. They
   take their colours from the tokens above, so the navy stage and the print block
   recolour them without another word.                                    */
.aq-toggles { display: grid; gap: 2px; margin-top: 6px; }
.aq-intro-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.aq-intro-actions .aq-btn { min-height: 48px; }
.aq-play-settings { margin-top: 14px; border-top: 1px solid var(--aq-line); padding-top: 10px; }
.aq-play-settings > summary, .aq-performance > summary { cursor: pointer; font-weight: 700; color: var(--aq-brand); }
.aq-play-settings > summary { min-height: 44px; display: flex; align-items: center; }
.aq-play-settings > summary::marker, .aq-performance > summary::marker { color: var(--aq-brand); }
.aq-play-settings .aq-note { margin-top: 8px; }
.aq-quick-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: .88rem; }
#almofiid-quiz .aq-quick-links a { color: var(--aq-brand); text-underline-offset: 4px; }
#almofiid-quiz .aq-play-settings :is(p, label, summary), #almofiid-quiz .aq-quick-links a { color: inherit; }
#almofiid-quiz .aq-play-settings .aq-note { color: var(--aq-brand); }
#almofiid-quiz .aq-play-settings .aq-full-intro { color: #dfe7ef; }
#almofiid-quiz .aq-play-settings .aq-quiet, #almofiid-quiz .aq-play-settings .aq-timer-toggle label { color: var(--aq-mute); }
#almofiid-quiz .aq-play-settings > summary, #almofiid-quiz .aq-quick-links a { color: var(--aq-brand); }
.aq :is(a, button, summary, input):focus-visible { outline: 3px solid #7ab8ff; outline-offset: 3px; }

/* a button that must not compete with the one that matters. The id prefix is what lets these two
   outrank `.aq-millionaire .aq-btn:not(.aq-primary)` without reaching for !important. */
#almofiid-quiz .aq-btn.aq-wipe { border-color: rgba(255, 142, 145, .45); background: rgba(255, 142, 145, .1); color: var(--aq-wrong); }
#almofiid-quiz .aq-btn.aq-wipe:hover:not(:disabled) { border-color: #ff8e91; background: rgba(255, 142, 145, .2); color: #ffd2ce; box-shadow: none; }
#almofiid-quiz .aq-btn.aq-danger { border-color: #c0392c; background: #8e1f18; color: #fff; text-shadow: none; }
#almofiid-quiz .aq-btn.aq-danger:hover:not(:disabled) { background: #a82c24; box-shadow: 0 8px 22px rgba(179, 38, 30, .35); }
#almofiid-quiz .aq-quiet-btn { font-weight: 600; font-size: .9rem; color: var(--aq-mute); }

.aq-resume {
	border: 1.5px solid rgba(246, 198, 94, .5);
	border-radius: 14px;
	background: rgba(246, 198, 94, .09);
	padding: 16px 14px 14px;
	margin: 16px 0 4px;
}
.aq-resume h3 { margin: 0 0 4px; font-size: 1.12rem; color: var(--aq-brand); }
.aq-resume .aq-lead { margin-bottom: 12px; }

/* the running scoreboard: what the player is allowed to see while it plays */
.aq-hud-points { margin: 0; color: var(--aq-mute); font-size: .86rem; white-space: nowrap; }
#almofiid-quiz #aq-play .aq-hud-points strong { color: var(--aq-brand); font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.aq-progress { margin: 0 0 16px; }
.aq-question-track { display: grid; grid-template-columns: repeat(8, minmax(24px, 1fr)); gap: 5px; margin: 0 0 10px; padding: 0; list-style: none; }
#almofiid-quiz .aq-question-track > li { list-style: none; display: grid; place-items: center; min-width: 24px; height: 28px; border: 1px solid var(--aq-line); border-radius: 7px; background: rgba(255, 255, 255, .05); color: var(--aq-mute); font-size: .72rem; font-weight: 800; line-height: 1; }
#almofiid-quiz .aq-question-track > li.is-current { border-color: var(--aq-brand); background: var(--aq-brand-soft); color: var(--aq-brand); box-shadow: inset 0 0 0 1px var(--aq-brand); }
#almofiid-quiz .aq-question-track > li.is-right { border-color: var(--aq-right); background: var(--aq-right-soft); color: var(--aq-right); }
#almofiid-quiz .aq-question-track > li.is-wrong { border-color: var(--aq-wrong); background: var(--aq-wrong-soft); color: var(--aq-wrong); }
.aq-performance { margin: 0 0 10px; }
.aq-performance > summary { min-height: 36px; width: fit-content; padding: 6px 0; }
.aq-performance .aq-stats { margin-top: 8px; }
.aq-level-details { margin-bottom: 0; }
.aq-stats { display: grid; gap: 7px; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); margin: 0 0 10px; padding: 0; list-style: none; }
.aq-stats li {
	display: flex;
	flex-direction: column;
	gap: 2px;
	background: rgba(255, 255, 255, .05);
	border: 1px solid var(--aq-line);
	border-radius: 11px;
	padding: 7px 11px;
}
.aq-stats span { color: var(--aq-mute); font-size: .74rem; line-height: 1.4; }
.aq-stats strong { font-size: 1.16rem; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--aq-ink); }
.aq-stats-nine { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.aq-stats-nine strong { font-size: 1.02rem; }
.aq-bar { height: 9px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.aq-bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #6b5318, var(--aq-brand) 60%, #fff0c4); transition: width .35s ease; }

/* the verdict: the answer arrives the moment the player commits, never before */
.aq-feedback { border: 1.5px solid var(--aq-line); border-radius: 13px; padding: 12px 14px; margin-top: 14px; background: rgba(255, 255, 255, .04); }
.aq-feedback:has(.is-good) { border-color: rgba(87, 217, 164, .55); background: var(--aq-right-soft); }
.aq-feedback:has(.is-bad) { border-color: rgba(255, 142, 145, .5); background: var(--aq-wrong-soft); }
.aq-feedback > p { margin: 0; }
.aq-feedback > p + p { margin-top: 6px; }
.aq-verdict { font-size: 1.1rem; font-weight: 800; }
.aq-verdict.is-good { color: var(--aq-right); }
.aq-verdict.is-bad { color: var(--aq-wrong); }
.aq-awarded { font-weight: 700; color: var(--aq-brand); font-variant-numeric: tabular-nums; }
.aq-solution { color: var(--aq-ink); }
.aq-solution strong { color: var(--aq-right); }

/* the committed plate: the hit in green, the miss in red, everything else quiet */
.aq-millionaire .aq-options .aq-opt.is-hit { border-color: #57d9a4; background: linear-gradient(180deg, #14402f, #0e2b22); box-shadow: inset 0 0 0 1px rgba(87, 217, 164, .45); }
.aq-millionaire .aq-options .aq-opt.is-hit .aq-plate { background: #57d9a4; color: #06211a; }
.aq-millionaire .aq-options .aq-opt.is-miss { border-color: #ff8e91; background: linear-gradient(180deg, #451d1f, #2c1315); }
.aq-millionaire .aq-options .aq-opt.is-miss .aq-plate { background: #ff8e91; color: #33090a; }
.aq-millionaire .aq-options .aq-opt:has(input:disabled) { cursor: default; }
.aq-millionaire .aq-options .aq-opt:has(input:disabled):not(.is-hit):not(.is-miss) { opacity: .5; }
.aq-millionaire .aq-options .aq-opt:has(input:disabled):hover { border-color: rgba(199, 212, 228, .28); background: linear-gradient(180deg, #142f4d, #0c223b); }
.aq-millionaire .aq-options .aq-opt.is-out:has(input:disabled) { opacity: .3; }

/* the per-level card */
.aq-level-result { border-top: 4px solid var(--aq-brand); }
.aq-level-result h2 { margin-bottom: .2em; }
.aq-status { display: inline-block; border-radius: 999px; padding: 5px 16px; font-weight: 800; font-size: .95rem; margin-bottom: 14px; }
.aq-status.is-good { background: var(--aq-right-soft); border: 1px solid rgba(87, 217, 164, .5); color: var(--aq-right); }
.aq-status.is-bad { background: var(--aq-wrong-soft); border: 1px solid rgba(255, 142, 145, .5); color: var(--aq-wrong); }
.aq-level-result .aq-note { margin: 16px 0 4px; }
.aq-tally li.good { border-inline-start: 4px solid var(--aq-right); }
.aq-tally li.bad { border-inline-start: 4px solid var(--aq-wrong); }

/* the two confirmations */
.aq-dialog { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); background: rgba(2, 8, 20, .82); }
/* the card is a navy surface wherever it hangs — the dialogs sit outside the four panels that
   redefine the tokens, so without this block their buttons resolve the PAPER --aq-ink (#17201f)
   and vanish on the navy gradient. The card carries its own tokens instead. */
.aq-dialog-card {
	--aq-ink: #f6f8fd;
	--aq-mute: #c7d4e4;
	--aq-line: rgba(246, 198, 94, .3);
	--aq-card: #0c223b;
	--aq-bg: #142f4d;
	--aq-brand: #f6c65e;
	--aq-brand-soft: #3a301d;
	--aq-right: #57d9a4;
	--aq-right-soft: #10352a;
	--aq-wrong: #ff8e91;
	--aq-wrong-soft: #431f2a;
	--aq-gold: #f6c65e;
	width: min(94vw, 470px);
	background: radial-gradient(circle at 50% 0, rgba(54, 168, 247, .14), transparent 45%), linear-gradient(155deg, #142f4d, #0c223b 60%, #061426);
	border: 1.5px solid rgba(246, 198, 94, .42);
	border-radius: 22px;
	padding: 24px 22px;
	box-shadow: 0 28px 80px rgba(2, 8, 20, .7), inset 0 1px 0 rgba(255, 255, 255, .06);
	color: #f6f8fd;
	line-height: 1.85;
}
.aq-dialog-card .aq-confirm-q { margin: 0; font-size: 1.02rem; color: #f6e6bf; }
.aq-dialog-card .aq-actions { margin-top: 18px; }
.aq-dialog-card .aq-btn:focus-visible { outline: 3px solid #7ab8ff; outline-offset: 3px; }

/* The site's own sheets load after ours and two of them reach into the widget: `.entry p` paints
   every paragraph #6f6260 and `:is(h1..h6)` every heading #241e1d. On paper that is right; on the
   navy stage it is 1.5:1. They are (0,2,2) and (0,1,1), so an id prefix outranks them and hands the
   colour back to the panel — no !important, and the bank below keeps its paper ink untouched. */
#almofiid-quiz .aq-intro :is(h2, p),
#almofiid-quiz #aq-play :is(p, legend),
#almofiid-quiz #aq-level-result :is(h2, p, strong, span),
#almofiid-quiz #aq-result :is(h2, h3, p) { color: inherit; }
/* the dialogs and the welcome-back card hang outside the panels, so the same host rules reach
   them: `.entry p` painted the wipe question #6f6260 (2.6:1 on the card) and the heading rule
   painted «مرحبًا بعودتك!» #241e1d (1.2:1). The id prefix hands both back. */
#almofiid-quiz .aq-dialog-card :is(h2, h3, p, span, strong, label, legend, li) { color: inherit; }
#almofiid-quiz .aq-dialog-card .aq-confirm-q { color: #f6e6bf; }
#almofiid-quiz #aq-resume h3 { color: var(--aq-brand); }
#almofiid-quiz #aq-resume :is(p, li, strong, span) { color: inherit; }
/* then the lines that are deliberately not plain ink. Only tokens, never literals: the print
   block below flips these variables to black, and #aq-play is hidden on paper anyway. */
#almofiid-quiz .aq-intro .aq-note, #almofiid-quiz #aq-result .aq-note, #almofiid-quiz #aq-level-result .aq-note { color: var(--aq-brand); }
#almofiid-quiz .aq-intro .aq-quiet, #almofiid-quiz #aq-result .aq-quiet { color: var(--aq-mute); }
#almofiid-quiz #aq-play .aq-level, #almofiid-quiz #aq-play .aq-count { color: var(--aq-mute); }
#almofiid-quiz #aq-play .aq-clock.urgent { color: #ffc4bf; }
#almofiid-quiz #aq-play .aq-topic { color: var(--aq-gold); }
#almofiid-quiz #aq-play .aq-error, #almofiid-quiz #aq-level-result .aq-error { color: var(--aq-wrong); }
#almofiid-quiz #aq-play .aq-confirm-q { color: #f6e6bf; }
#almofiid-quiz #aq-level-result .aq-status, #almofiid-quiz #aq-play .aq-verdict { color: inherit; }
#almofiid-quiz #aq-level-result .aq-status.is-good, #almofiid-quiz #aq-play .aq-verdict.is-good { color: var(--aq-right); }
#almofiid-quiz #aq-level-result .aq-status.is-bad, #almofiid-quiz #aq-play .aq-verdict.is-bad { color: var(--aq-wrong); }
#almofiid-quiz #aq-play .aq-awarded { color: var(--aq-brand); }
#almofiid-quiz #aq-play .aq-whyline { color: var(--aq-mute); }
#almofiid-quiz #aq-play .aq-solution strong { color: var(--aq-right); }
#almofiid-quiz #aq-play .aq-stats span, #almofiid-quiz #aq-level-result .aq-stats span { color: var(--aq-mute); }
#almofiid-quiz #aq-result .aq-recap li > p:nth-child(3) { color: var(--aq-right); }
#almofiid-quiz #aq-result .aq-whyline { color: var(--aq-mute); }
/* `.entry a` is burgundy on paper, which is the site's own link colour and correct there — but the
   share chips sit on the navy stage, where #B8322B is 1.6:1. */
#almofiid-quiz #aq-result .aq-chip { color: var(--aq-ink); }
/* the theme numbers every list item inside .entry, and the bank wants that — its questions and
   options carry no number of their own. The recap writes "1." in the text and the chips are not a
   list, so only those two lose the marker. */
#almofiid-quiz .aq-recap ol > li, #almofiid-quiz .aq-tally > li { list-style: none; }
/* the scoreboard cells are cards, not bullets; `.entry ul li` would otherwise paint a disc in
   front of every one of them and the grid would clip it away. */
#almofiid-quiz .aq-stats > li { list-style: none; }

@media (max-width: 860px) {
	.aq-board { grid-template-columns: minmax(0, 1fr); gap: 14px; }
	.aq-ladder { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; }
	.aq-rung { flex: 0 0 auto; min-width: 148px; scroll-snap-align: center; }
	.aq-millionaire .aq-options { grid-template-columns: minmax(0, 1fr); }
	.aq-life { height: 34px; font-size: .68rem; padding: 0 9px; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
	.aq-rung.is-now, .aq-clock.urgent { animation: none; }
	.aq-btn, .aq-life, .aq-options .aq-opt { transition: none; }
	.aq-bar span, .aq-meter span { transition: none; }
	.aq-millionaire .aq-btn:hover:not(:disabled) { transform: none; }
}

@media print {
	.aq-millionaire .aq-intro, .aq-millionaire #aq-level-result, .aq-millionaire #aq-result {
		--aq-ink: #000; --aq-mute: #333; --aq-line: #ccc; --aq-brand: #000; --aq-right: #000; --aq-wrong: #000;
		background: #fff; border: 0; box-shadow: none; color: #000; padding: 0 0 10pt;
	}
	.aq-millionaire .aq-points strong, .aq-millionaire .aq-score strong { color: #000; font-size: 22pt; }
	.aq-millionaire .aq-note { background: #fff; border: 1px solid #999; color: #000; }
	/* the facts pills and the tally cards (welcome-back list, level counts) wear literal light
	   ink on screen, which the variable flip above cannot reach — on paper they were 1.1:1 */
	.aq-millionaire .aq-facts li, .aq-millionaire .aq-tally li { background: #fff; border-color: #bbb; color: #000; }
	.aq-millionaire .aq-resume { background: #fff; border-color: #999; }
	.aq-millionaire .aq-recap li { background: #fff !important; border: 1px solid #bbb; }
	.aq-millionaire .aq-recap li > p:nth-child(3) { color: #000; }
	.aq-millionaire .aq-whyline { color: #333; }
	.aq-qs > li { content-visibility: visible; }
}
.aq-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.aq-links h2 { width: 100%; font-size: 1.05rem; }
.aq-links a { background: #fff; border: 1px solid var(--aq-line); border-radius: 999px; padding: 6px 14px; font-size: .88rem; text-decoration: none; color: var(--aq-brand); }
.aq-links a:hover { background: var(--aq-brand-soft); }

@media (max-width: 520px) {
	.aq-panel, .aq-bank, .aq-guide { padding: 18px 15px; border-radius: 16px; }
	.aq-hero { grid-template-columns: minmax(0, 1fr); gap: 8px; text-align: center; }
	.aq-trophy { width: 108px; }
	.aq-hero h2 { font-size: clamp(1.55rem, 8vw, 2rem); }
	.aq h2 { font-size: 1.24rem; }
	.aq-field legend { font-size: 1.05rem; }
	.aq-actions .aq-btn { flex: 1 1 100%; }
	.aq-opts { grid-template-columns: 1fr; }
	.aq-stats { grid-template-columns: repeat(auto-fit, minmax(98px, 1fr)); gap: 5px; }
	.aq-stats li { padding: 6px 9px; border-radius: 9px; }
	.aq-stats strong { font-size: 1rem; }
	.aq-verdict { font-size: 1rem; }
}

@media print {
	.aq { max-width: none; }
	#aq-play, #aq-result .aq-actions, .aq-intro .aq-row, .aq-share, .aq-bank .aq-row, .aq-links, .aq-dialog, #aq-progress, #aq-level-result .aq-actions, #aq-level-result .aq-row, .aq-reading .aq-row, .aq-more { display: none !important; }
	.aq-panel, .aq-bank, .aq-guide { border: 0; padding: 0 0 10pt; margin: 0; break-inside: auto; }
	.aq-topic-bank { break-inside: avoid; background: #fff; border: 0; padding: 0; }
	.aq-topic-bank > summary::before { content: ""; }
	.aq-qs > li { break-inside: avoid; margin-bottom: 10pt; }
	.aq-opts li { padding: 1pt 6pt; font-size: .95em; }
	.aq-stem { margin-bottom: 3pt; }
	.aq-opts { grid-template-columns: 1fr; }
	.aq-explain { margin: 4pt 0 0; }
	.aq-explain > summary { display: none; }
	.aq-explain > p { margin: 0; font-size: .9em; color: #000; }
	.aq-guide details { border: 0; padding: 0; }
	.aq-sr { position: static; width: auto; height: auto; clip: auto; overflow: visible; white-space: normal; font-size: .8em; }
	@page { margin: 14mm; }
}
