/* =========================================================================================
   BLENDISH — css/reveal.css  ·  post-round reveal screen
   Owned by the reveal-meta lane. EVERY rule is scoped under `.bl-reveal` so it can never
   collide with css/ui.css. Mobile-first; >=44px touch targets; dark, high contrast.
   Load with: <link rel="stylesheet" href="css/reveal.css">
   ========================================================================================= */

.bl-reveal {
	--bl-bg: #0b0d12;
	--bl-panel: #141821;
	--bl-panel-2: #1b202b;
	--bl-line: rgba(255, 255, 255, 0.10);
	--bl-ink: #f2efe9;
	--bl-dim: rgba(242, 239, 233, 0.62);
	--bl-faint: rgba(242, 239, 233, 0.40);
	--bl-accent: #ff6b3d;
	--bl-good: #6ee7a8;
	--bl-bad: #ff4d6d;
	--bl-blue: #4aa3ff;
	--bl-r: 14px;

	position: relative;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 14px;
	width: 100%;
	max-height: 100%;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 16px 14px 24px;
	background: var(--bl-bg);
	color: var(--bl-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	-webkit-text-size-adjust: 100%;
}

.bl-reveal *,
.bl-reveal *::before,
.bl-reveal *::after { box-sizing: border-box; }

.bl-reveal h2,
.bl-reveal h3,
.bl-reveal p,
.bl-reveal ul,
.bl-reveal ol { margin: 0; padding: 0; }

.bl-reveal ul,
.bl-reveal ol { list-style: none; }

/* ------------------------------------------------------------------ header -- */
.bl-reveal .bl-rv-head { display: flex; flex-direction: column; gap: 8px; }

.bl-reveal .bl-rv-verdict {
	align-self: flex-start;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.14em;
	padding: 5px 10px;
	border-radius: 999px;
	border: 1px solid currentColor;
}
.bl-reveal .bl-rv-verdict.is-caught { color: var(--bl-accent); }
.bl-reveal .bl-rv-verdict.is-safe   { color: var(--bl-good); }
.bl-reveal .bl-rv-verdict.is-unseen { color: var(--bl-faint); }

.bl-reveal .bl-rv-headline {
	font-size: clamp(20px, 5.6vw, 30px);
	line-height: 1.2;
	font-weight: 750;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

.bl-reveal .bl-rv-sub {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 13px;
	color: var(--bl-dim);
}
.bl-reveal .bl-rv-map { color: var(--bl-ink); font-weight: 600; }
.bl-reveal .bl-rv-dot { color: var(--bl-faint); }

/* -------------------------------------------------------------------- body -- */
.bl-reveal .bl-rv-body {
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
}

.bl-reveal .bl-rv-left,
.bl-reveal .bl-rv-right {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
}

/* ------------------------------------------------------------------ replay -- */
.bl-reveal .bl-rv-stage {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	max-height: 62vh;
	min-height: 260px;   /* a short/landscape viewport must not letterbox the map to a strip */
	border-radius: var(--bl-r);
	overflow: hidden;
	background: #0d0f14;
	border: 1px solid var(--bl-line);
}
.bl-reveal .bl-rv-canvas { display: block; width: 100%; height: 100%; }

.bl-reveal .bl-rv-transport {
	display: flex;
	align-items: center;
	gap: 12px;
}

.bl-reveal .bl-rv-play {
	flex: 0 0 auto;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1px solid var(--bl-line);
	background: var(--bl-panel-2);
	color: var(--bl-ink);
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.bl-reveal .bl-rv-play:active { transform: scale(0.94); }
.bl-reveal .bl-rv-play.is-playing { color: var(--bl-accent); border-color: var(--bl-accent); }

.bl-reveal .bl-rv-scrub {
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;                 /* touch target; the visual track is drawn on the thumb */
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	cursor: pointer;
}
.bl-reveal .bl-rv-scrub::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.14);
}
.bl-reveal .bl-rv-scrub::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 22px; height: 22px;
	margin-top: -8px;
	border-radius: 50%;
	background: var(--bl-accent);
	border: 2px solid #0b0d12;
}
.bl-reveal .bl-rv-scrub::-moz-range-track {
	height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.14);
}
.bl-reveal .bl-rv-scrub::-moz-range-thumb {
	width: 20px; height: 20px; border: 2px solid #0b0d12; border-radius: 50%;
	background: var(--bl-accent);
}

.bl-reveal .bl-rv-clock {
	flex: 0 0 auto;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 14px;
	color: var(--bl-dim);
	min-width: 46px;
	text-align: right;
}

.bl-reveal .bl-rv-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	font-size: 12px;
	color: var(--bl-dim);
}
.bl-reveal .bl-rv-leg { display: inline-flex; align-items: center; gap: 6px; }
.bl-reveal .bl-rv-leg i {
	width: 10px; height: 10px; border-radius: 50%;
	background: var(--c, #fff);
	display: inline-block;
}
.bl-reveal .bl-rv-leg.is-ring i { background: transparent; border: 2px solid var(--c, #fff); }
.bl-reveal .bl-rv-leg.is-pin i { opacity: 0.55; box-shadow: 0 0 0 2px var(--c, #fff) inset; background: transparent; }

/* ------------------------------------------------------------------- cards -- */
.bl-reveal .bl-rv-card {
	background: var(--bl-panel);
	border: 1px solid var(--bl-line);
	border-radius: var(--bl-r);
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.bl-reveal .bl-rv-card h3 {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--bl-faint);
}

/* ------------------------------------------------------------------- score -- */
.bl-reveal .bl-rv-scoretop { display: flex; align-items: baseline; gap: 10px; }
.bl-reveal .bl-rv-scorenum {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: clamp(38px, 12vw, 56px);
	font-weight: 800;
	line-height: 1;
	color: var(--bl-accent);
}
.bl-reveal .bl-rv-scorelabel {
	font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--bl-faint);
}

.bl-reveal .bl-rv-bar {
	height: 10px;
	border-radius: 5px;
	background: rgba(255, 255, 255, 0.08);
	overflow: hidden;
}
.bl-reveal .bl-rv-barfill {
	height: 100%;
	min-width: 2px;
	border-radius: 5px;
	background: linear-gradient(90deg, var(--bl-accent), #ffc93d);
}
.bl-reveal .bl-rv-barcap { font-size: 13px; color: var(--bl-dim); }

.bl-reveal .bl-rv-rows { display: flex; flex-direction: column; }
.bl-reveal .bl-rv-rows li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 38px;
	padding: 4px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	font-size: 14px;
}
.bl-reveal .bl-rv-rows li:last-child { border-bottom: 0; }
.bl-reveal .bl-rv-rk { color: var(--bl-dim); }
.bl-reveal .bl-rv-rv {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-weight: 700;
	white-space: nowrap;
}
.bl-reveal .bl-rv-rows li.is-good .bl-rv-rv { color: var(--bl-good); }
.bl-reveal .bl-rv-rows li.is-bad  .bl-rv-rv { color: var(--bl-bad); }

.bl-reveal .bl-rv-lesson {
	border-radius: 10px;
	padding: 12px;
	border-left: 4px solid var(--bl-faint);
	background: rgba(255, 255, 255, 0.04);
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.bl-reveal .bl-rv-lesson strong { font-size: 15px; }
.bl-reveal .bl-rv-lesson p { font-size: 13.5px; color: var(--bl-dim); }
.bl-reveal .bl-rv-lesson.is-fail  { border-left-color: var(--bl-bad); background: rgba(255, 77, 109, 0.10); }
.bl-reveal .bl-rv-lesson.is-fail strong { color: var(--bl-bad); }
.bl-reveal .bl-rv-lesson.is-win   { border-left-color: var(--bl-good); background: rgba(110, 231, 168, 0.09); }
.bl-reveal .bl-rv-lesson.is-win strong { color: var(--bl-good); }
.bl-reveal .bl-rv-lesson.is-mixed { border-left-color: var(--bl-accent); background: rgba(255, 107, 61, 0.09); }
.bl-reveal .bl-rv-lesson.is-mixed strong { color: var(--bl-accent); }

/* ---------------------------------------------------------------- timeline -- */
.bl-reveal .bl-rv-tl { display: flex; flex-direction: column; gap: 8px; }
.bl-reveal .bl-rv-tlitem {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	min-height: 44px;
	padding: 9px 10px;
	border-radius: 10px;
	background: var(--bl-panel-2);
	border: 1px solid transparent;
	border-left: 3px solid var(--c, var(--bl-accent));
	cursor: pointer;
	font-size: 13.5px;
	-webkit-tap-highlight-color: transparent;
}
.bl-reveal .bl-rv-tlitem:hover,
.bl-reveal .bl-rv-tlitem:focus-visible { border-color: var(--c, var(--bl-accent)); outline: none; }
.bl-reveal .bl-rv-tlitem.is-now { background: rgba(255, 107, 61, 0.16); border-color: var(--c, var(--bl-accent)); }
.bl-reveal .bl-rv-tlitem.is-best { box-shadow: 0 0 0 1px var(--c, var(--bl-accent)) inset; }
.bl-reveal .bl-rv-tltime {
	flex: 0 0 auto;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-weight: 700;
	color: var(--c, var(--bl-accent));
}
.bl-reveal .bl-rv-tltext { color: var(--bl-dim); }
/* `hidden` loses to the list's `display:flex` on the item, so restate it */
.bl-reveal .bl-rv-tlitem[hidden] { display: none; }
.bl-reveal .bl-rv-more {
	margin-top: 10px;
	width: 100%;
	min-height: 44px;
	padding: 11px 14px;
	border-radius: 10px;
	background: transparent;
	border: 1px dashed var(--bl-line);
	color: var(--bl-dim);
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.bl-reveal .bl-rv-more:hover,
.bl-reveal .bl-rv-more:focus-visible {
	color: var(--bl-ink);
	border-color: var(--bl-accent);
	outline: none;
}
.bl-reveal .bl-rv-empty { font-size: 13.5px; color: var(--bl-bad); }

/* ---------------------------------------------------------------- disguise -- */
.bl-reveal .bl-rv-dgrow { display: flex; align-items: center; gap: 10px; }
.bl-reveal .bl-rv-sw { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.bl-reveal .bl-rv-swcanvas {
	width: 100%;
	aspect-ratio: 1 / 1;
	height: auto;
	border-radius: 10px;
	border: 1px solid var(--bl-line);
	display: block;
	image-rendering: auto;
}
.bl-reveal .bl-rv-swlabel {
	font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bl-faint);
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bl-reveal .bl-rv-swhex {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 11px; color: var(--bl-dim);
}
.bl-reveal .bl-rv-vs { flex: 0 0 auto; text-align: center; }
.bl-reveal .bl-rv-match {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 22px; font-weight: 800;
}
.bl-reveal .bl-rv-matchlabel {
	font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bl-faint);
}
.bl-reveal .bl-rv-dgnote { font-size: 13px; color: var(--bl-dim); }

/* ----------------------------------------------------------------- profile -- */
.bl-reveal .bl-rv-pgrid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
	gap: 10px;
}
.bl-reveal .bl-rv-pstat {
	background: var(--bl-panel-2);
	border-radius: 10px;
	padding: 9px 10px;
	min-width: 0;
}
.bl-reveal .bl-rv-pv {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 18px; font-weight: 800;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bl-reveal .bl-rv-pk {
	font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bl-faint);
}
.bl-reveal .bl-rv-records { display: flex; flex-wrap: wrap; gap: 6px; }
.bl-reveal .bl-rv-badge {
	font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em;
	padding: 5px 9px; border-radius: 999px;
	color: #0b0d12; background: var(--bl-good);
}

/* ----------------------------------------------------------------- actions -- */
.bl-reveal .bl-rv-actions {
	position: sticky;
	bottom: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding-top: 10px;
	padding-bottom: max(6px, env(safe-area-inset-bottom));
	background: linear-gradient(180deg, rgba(11, 13, 18, 0) 0%, var(--bl-bg) 34%);
}
.bl-reveal .bl-rv-btn {
	flex: 1 1 150px;
	min-height: 50px;
	padding: 0 16px;
	border-radius: 12px;
	border: 1px solid var(--bl-line);
	background: var(--bl-panel-2);
	color: var(--bl-ink);
	font: inherit;
	font-size: 14px;
	font-weight: 800;
	letter-spacing: 0.08em;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.bl-reveal .bl-rv-btn:active { transform: translateY(1px); }
.bl-reveal .bl-rv-btn[disabled] { opacity: 0.5; cursor: default; }
.bl-reveal .bl-rv-btn.is-share {
	background: var(--bl-accent);
	border-color: var(--bl-accent);
	color: #14100c;
}
.bl-reveal .bl-rv-btn.is-ghost { background: transparent; }
.bl-reveal .bl-rv-sharenote {
	font-size: 12.5px;
	color: var(--bl-dim);
	min-height: 16px;
	text-align: center;
}

/* ------------------------------------------------------------------ wide -- */
/* Driven by OUR OWN measured width (js/reveal.js adds `is-wide` from a ResizeObserver),
   NOT by a viewport media query. We are mounted inside js/ui.js's `.reveal-inner`, which is
   a ~430px centred column on a 1100px desktop — a `@media (min-width: 720px)` rule fired
   there and split a 430px column into two 200px columns, shrinking the replay map to a
   thumbnail and wrapping every near-miss sentence onto four lines. An embedded module must
   respond to the box it is actually in. */
.bl-reveal.is-wide { padding: 22px 22px 28px; gap: 18px; font-size: 16px; }
.bl-reveal.is-wide .bl-rv-body {
	flex-direction: row;
	align-items: flex-start;
	gap: 18px;
}
.bl-reveal.is-wide .bl-rv-left { flex: 1 1 52%; position: sticky; top: 0; }
.bl-reveal.is-wide .bl-rv-right { flex: 1 1 48%; }
/* Taller than square when there is room: the right column always out-runs the replay, and a
   1:1 map left a screen-height hole beside it in every desktop screenshot. */
.bl-reveal.is-wide .bl-rv-stage { max-height: none; aspect-ratio: 4 / 5; }
.bl-reveal.is-wide .bl-rv-actions { justify-content: flex-end; }
.bl-reveal.is-wide .bl-rv-btn { flex: 0 1 auto; min-width: 170px; }

/* The headline sized itself in `vw`, which is the viewport again: at 430px wide inside a
   1100px desktop it set 30px type in a column that could not hold it. Size from the module. */
.bl-reveal .bl-rv-headline { font-size: 21px; }
.bl-reveal.is-wide .bl-rv-headline { font-size: 30px; }

/* A disguise card with no recorded backdrop has ONE swatch, and `flex: 1 1 0` stretched that
   single square across the whole card — an unpainted body rendered as a 400px white block
   that read as a broken image. Missing data must look small, not loud. */
.bl-reveal .bl-rv-dgrow.is-solo { align-items: flex-start; }
.bl-reveal .bl-rv-dgrow.is-solo .bl-rv-sw { flex: 0 0 auto; width: 132px; max-width: 40%; }

/* The host screen (js/ui.js `#screen-result`) draws its own outcome banner and its own
   one-line story above us. Two verdicts and two headlines stacked is the single worst thing
   this screen can do, so js/reveal.js hides the duplicates and marks itself `is-hosted`. */
.bl-reveal.is-hosted .bl-rv-verdict { display: none; }

@media (prefers-reduced-motion: reduce) {
	.bl-reveal * { transition: none !important; animation: none !important; }
}

/* =========================================================================================
   ENTRANCE — the round ending should be a moment, not a cut. (FEEL-LOG F8)
   In the played session the last frame of the room was followed immediately by a wall of
   statistics; nothing marked the end of the round. js/juice.js now fires a white flash and
   the reveal fanfare on the phase change; this is the other half of that beat — the screen
   arrives instead of appearing, and the sections land one after another so the eye is led
   down the page rather than dropped on it.
   Scoped under .bl-reveal like everything else in this file, and animation only: no layout
   property is touched, so nothing here can move the content the lane above laid out.
   ========================================================================================= */

@keyframes bl-rv-arrive {
	from { opacity: 0; transform: translateY(14px) scale(0.985); }
	to   { opacity: 1; transform: none; }
}
@keyframes bl-rv-rise {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: none; }
}

.bl-reveal { animation: bl-rv-arrive 320ms cubic-bezier(.16, .84, .32, 1) both; }

/* The stagger is capped at eight: past that the last card would be waiting on the
   player rather than the player on the card. Everything below the cap animates as one. */
.bl-reveal > * { animation: bl-rv-rise 300ms cubic-bezier(.16, .84, .32, 1) both; }
.bl-reveal > :nth-child(1) { animation-delay: 90ms; }
.bl-reveal > :nth-child(2) { animation-delay: 150ms; }
.bl-reveal > :nth-child(3) { animation-delay: 205ms; }
.bl-reveal > :nth-child(4) { animation-delay: 255ms; }
.bl-reveal > :nth-child(5) { animation-delay: 300ms; }
.bl-reveal > :nth-child(6) { animation-delay: 340ms; }
.bl-reveal > :nth-child(7) { animation-delay: 375ms; }
.bl-reveal > :nth-child(n + 8) { animation-delay: 405ms; }

@media (prefers-reduced-motion: reduce) {
	.bl-reveal,
	.bl-reveal > * { animation: none !important; }
}
