/* ============================================================================
 * Divided — play-surface styles.
 *
 * Art direction: "2a Duotone Rounded" (docs/visual-reference-sketch.html) — magenta left
 * half, teal right half, near-black ground, round d-pad buttons, lit state = white echo
 * + hot gradient + pale border. (The sketch's seam ticks were later dropped — owner
 * call, 2026-07-16.)
 *
 * Hard rules honored here:
 *  - the lit state is a LUMINANCE + position event (peripheral-vision-loud); color is
 *    identity/reinforcement only — every theme preset keeps the white-echo treatment;
 *  - all hot-path animations are transform/opacity/filter only (compositor-friendly);
 *  - the occlusion bloom (::after) extends ~1.5× beyond the button so a resting thumb
 *    can't fully hide the signal;
 *  - geometry lives in custom properties so themes/tuning can reach it without JS edits.
 * ========================================================================== */

/* --- theme presets: half-identity custom properties ------------------------------- */
/* duotone-2a (default) — values from the committed sketch. */
:root {
	--dv-bg: #101014;
	--dv-left-hi: #FF6BBC;
	--dv-left-hot: #FF3EA5;
	--dv-left-lo: #E5258C;
	--dv-left-border: #FFD7EC;
	--dv-left-ink: #2B0520;
	--dv-left-bg: linear-gradient(160deg, #3D1237 0%, #2B0C27 55%, #1F081D 100%);
	--dv-right-hi: #4CF2D8;
	--dv-right-hot: #00E5C7;
	--dv-right-lo: #00C4AA;
	--dv-right-border: #CFFFF4;
	--dv-right-ink: #012A24;
	--dv-right-bg: linear-gradient(200deg, #074049 0%, #05333A 55%, #032329 100%);

	/* geometry — pads/buttons grown (owner round 3: misses OUTSIDE the buttons on a
	 * regular iPhone under Rush pace; there was room). Diagonal-neighbor clearance
	 * holds: at ratio 0.32 + 14px hit margin, adjacent hit circles stay apart. */
	--dv-seam-w: 18px;
	--dv-pad-size: clamp(210px, 62vh, 380px);
	--dv-btn-size: calc(var(--dv-pad-size) * 0.32);
	--dv-pad-inset-x: 4.5vw;
	--dv-pad-inset-y: max(4vh, 12px);
	/* signal mirrors (top-inner corner of each half; inset-x measured from the seam) */
	--dv-mirror-size: clamp(60px, 19vh, 120px);
	--dv-mirror-inset-x: max(4vw, 22px);
	--dv-mirror-inset-y: max(2vh, 10px);
	/* in-round exit strip (thumb-generous; must clear the pads' hit margins) */
	--dv-pause-strip-w: 76px;

	/* motion (gameplay-relevant durations are runtime-writable) */
	--dv-lit-in-ms: 120ms;
}

/* ember-ice — Pro pack preview (amber vs azure; colorblind-reasonable pair). */
:root[data-dv-theme="ember-ice"] {
	--dv-left-hi: #FFC65C;
	--dv-left-hot: #FFB020;
	--dv-left-lo: #E08D00;
	--dv-left-border: #FFE9C2;
	--dv-left-ink: #2A1B00;
	--dv-left-bg: linear-gradient(160deg, #3A2506 0%, #2B1B04 55%, #1D1203 100%);
	--dv-right-hi: #6FA6FF;
	--dv-right-hot: #3E8BFF;
	--dv-right-lo: #1F6AE0;
	--dv-right-border: #D4E4FF;
	--dv-right-ink: #04173A;
	--dv-right-bg: linear-gradient(200deg, #0A1F45 0%, #081835 55%, #051025 100%);
}

/* mono-contrast — free colorblind-safe alternative: luminance-separated near-mono pair
 * (accessibility is never charged for). */
:root[data-dv-theme="mono-contrast"] {
	--dv-left-hi: #F4F1FF;
	--dv-left-hot: #DDD6F3;
	--dv-left-lo: #B9AFD9;
	--dv-left-border: #FFFFFF;
	--dv-left-ink: #17141F;
	--dv-left-bg: linear-gradient(160deg, #2E2B38 0%, #232029 55%, #18161E 100%);
	--dv-right-hi: #8E8798;
	--dv-right-hot: #6E6878;
	--dv-right-lo: #514C5A;
	--dv-right-border: #CFC9DA;
	--dv-right-ink: #0E0C12;
	--dv-right-bg: linear-gradient(200deg, #131118 0%, #0E0C12 55%, #09080C 100%);
}

/* --- base ------------------------------------------------------------------------- */
html,
body {
	margin: 0;
	height: 100%;
	background: var(--dv-bg);
	color: var(--d-color-foreground, #f1f0f5);
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
	overflow: hidden;
	overscroll-behavior: none;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	-webkit-touch-callout: none;
}

#app {
	position: fixed;
	inset: 0;
}

/* Author display rules (e.g. .dv-row { display:flex }) must never defeat the HTML
 * `hidden` attribute the runtime toggles. */
[hidden] {
	display: none !important;
}

/* --- the stage: two halves, seam, HUD --------------------------------------------- */
.dv-stage {
	position: fixed;
	inset: 0;
	display: grid;
	grid-template-columns: 1fr var(--dv-seam-w) 1fr;
	/* Mirrored symmetry: pad BOTH sides by the larger horizontal inset so a one-sided
	   notch never makes the halves unequal (brief §8: mirrored-identical). */
	padding: env(safe-area-inset-top, 0px)
		max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px), 0px)
		max(env(safe-area-inset-bottom, 0px), 8px)
		max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px), 0px);
	touch-action: none;
}

.dv-half {
	position: relative;
	border-radius: 14px;
	overflow: hidden;
}
.dv-half--l {
	grid-column: 1;
	background: var(--dv-left-bg);
}
.dv-half--r {
	grid-column: 3;
	background: var(--dv-right-bg);
}

/* Seam: the split IS the brand — a clean dark gap (grid column 2, the stage background
 * showing through; no element needed). The old diamond ticks were dropped as noise once
 * the signal mirrors began flanking the seam — the diamond motif lives on in the
 * results grade and the app icon. */

/* Seam time bar (owner call 2026-07-16): a thin dual-identity column inside the seam
 * that drains over the round — ambient time-sense, not a judgment number, which is why
 * it STAYS VISIBLE in zen by default (it also spares zen the surprise buzzer; hiding it
 * is one `:root[data-dv-zen]` rule away if the owner vetoes on device). One CSS scaleY
 * animation carries the whole drain: the runtime arms it at running start (duration =
 * the round's logical length), freezes it via animation-play-state on pause, and
 * re-arms it after a mid-round duration patch with a negative delay for the elapsed
 * fraction. Transform-only ⇒ compositor-friendly ⇒ hot-path-law safe. Top/bottom track
 * the stage padding so the bar spans exactly the halves' height. */
.dv-timebar {
	position: absolute;
	left: calc(50% - var(--dv-timebar-w, 5px) / 2);
	top: env(safe-area-inset-top, 0px);
	bottom: max(env(safe-area-inset-bottom, 0px), 8px);
	width: var(--dv-timebar-w, 5px);
	border-radius: 999px;
	background: linear-gradient(180deg, var(--dv-left-hot), var(--dv-right-hot));
	opacity: 0.9;
	transform-origin: center bottom; /* remaining time settles like sand */
	pointer-events: none;
	z-index: 1; /* under the pause strip (2) and the HUD (3) */
}
/* No fallback duration on purpose (law 4: round length only ever flows from config
 * via the runtime-set var) — a missing var invalidates the declaration and the bar
 * simply stays full, which is the honest failure mode. */
.dv-timebar[data-run] {
	animation: dv-timebar-drain var(--dv-timebar-total) linear forwards;
	/* re-arm after a duration patch: start the animation mid-flight */
	animation-delay: calc(-1 * var(--dv-timebar-elapsed, 0ms));
}
@keyframes dv-timebar-drain {
	from {
		transform: scaleY(1);
	}
	to {
		transform: scaleY(0);
	}
}

/* HUD: non-interactive center strip. Big, glanceable, mostly ignorable.
 * The big numeral counts HITS (+1 per catch — self-explanatory mid-round); the
 * composite score only appears on the results screen, where it has context. */
.dv-hud {
	position: absolute;
	left: 50%;
	/* sits 36px below the pause glyph's top edge (its 30px box + a 6px gap), tracking
	 * the same safe-area base so a notch can never collapse the two together */
	top: calc(max(env(safe-area-inset-top, 0px), 8px) + 36px);
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	pointer-events: none;
	z-index: 3;
	text-align: center;
}
/* Zen mode: no HUD, no numbers — just the two streams. (Set on <html> like the theme.) */
:root[data-dv-zen] .dv-hud {
	display: none;
}
.dv-hud-hits {
	font-size: clamp(28px, 7vh, 44px);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
	text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}
.dv-hud-streak {
	min-height: 1.2em;
	font-size: clamp(13px, 3vh, 18px);
	font-weight: 700;
	color: var(--dv-left-hi);
}
/* (No seconds numeral — the seam time bar carries the clock; owner call 2026-07-16.) */

/* In-round exit, step 1 (owner call 2026-07-16): the seam column is the one tappable
 * thing outside the thumb arcs mid-round — an INVISIBLE full-height strip, wider than
 * the visible 18px seam, that pauses on tap; the pause card then offers "Exit round".
 * Positional (works in zen). Width is thumb-generous but never at the pads' expense:
 * on squarish viewports (desktop windows near 4:3) the halves narrow while the pads
 * keep their 52vh size, so a fixed 76px would cover the seam-side buttons' invisible
 * hit margins — clamp against the real clearance (pad inset + pad size + hit-margin
 * overhang + breathing room, mirrored on both halves). A negative calc floors the
 * width at 0: no strip beats a stolen gameplay tap (desktop keeps Escape). */
.dv-pause-strip {
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: min(
		var(--dv-pause-strip-w),
		calc(
			100vw - 2 * (var(--dv-pad-inset-x) + var(--dv-pad-size) + 18px +
			max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px), 0px))
		)
	);
	transform: translateX(-50%);
	z-index: 2; /* over the halves for hit-testing; under the HUD text (z 3) */
}

/* In-round exit, visible affordance (owner call 2026-07-17): the strip above is
 * invisible — undiscoverable to a first-time player. This is its SEEN twin: a discreet
 * pause control at the top of the seam, on the center line between the thumbs (the
 * "center-top chrome" doc 02 anticipated — NOT a corner ✕, which the grip law forbids).
 * The runtime binds the SAME pause handler here, so it works even where the strip's
 * width clamps toward 0 (squarish desktop). z-index 5 keeps it above the strip (2) and
 * HUD (3) so its own pointerdown wins the tap. It lives on #app, under the shell overlays
 * (z 8) — so it shows only during a live round/countdown, never over a menu or the pause
 * card. Kept out of zen's HUD purge on purpose: quitting must never require the HUD. */
.dv-pause-btn {
	position: absolute;
	left: 50%;
	top: max(env(safe-area-inset-top, 0px), 8px);
	transform: translateX(-50%);
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 30px;
	height: 30px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--d-color-surface, #1c1a24) 62%, transparent);
	border: 1px solid var(--d-color-border, #2c2938);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	cursor: pointer;
	touch-action: none; /* pointerdown = pause; no scroll/zoom gesture to wait on */
	z-index: 5;
	transition: opacity 120ms ease, transform 90ms ease;
}
/* the pause glyph itself — two bars, drawn (no emoji: renders identically everywhere) */
.dv-pause-btn::before,
.dv-pause-btn::after {
	content: "";
	width: 3px;
	height: 11px;
	border-radius: 2px;
	background: color-mix(in srgb, var(--d-color-foreground, #f1f0f5) 82%, transparent);
}
.dv-pause-btn:active {
	transform: translateX(-50%) scale(0.92);
	opacity: 0.85;
}

/* Pre-round countdown numeral — center, huge, non-interactive. */
.dv-countdown {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	font-size: clamp(64px, 30vh, 160px);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	pointer-events: none;
	z-index: 4;
	text-shadow: 0 4px 32px rgba(0, 0, 0, 0.6);
}
.dv-countdown[hidden] {
	display: none;
}

/* --- d-pads ------------------------------------------------------------------------ */
/* Anchored to the bottom-OUTER corner of each half: where thumbs rest in the grip. */
.dv-pad {
	position: absolute;
	bottom: var(--dv-pad-inset-y);
	inline-size: var(--dv-pad-size);
	aspect-ratio: 1;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: repeat(3, 1fr);
	place-items: center;
}
.dv-half--l .dv-pad {
	left: var(--dv-pad-inset-x);
}
.dv-half--r .dv-pad {
	right: var(--dv-pad-inset-x);
}

.dv-btn[data-btn="up"] {
	grid-area: 1 / 2;
}
.dv-btn[data-btn="left"] {
	grid-area: 2 / 1;
}
.dv-btn[data-btn="right"] {
	grid-area: 2 / 3;
}
.dv-btn[data-btn="down"] {
	grid-area: 3 / 2;
}

/* --- buttons: the five-state system ------------------------------------------------ */
.dv-btn {
	position: relative;
	width: var(--dv-btn-size);
	height: var(--dv-btn-size);
	border-radius: 50%;
	display: grid;
	place-items: center;
	outline: none;
	cursor: pointer;
	/* generous invisible hit target ~14px beyond the visible circle */
	margin: -14px;
	padding: 14px;
	background-clip: content-box;
}
.dv-btn i {
	font-style: normal;
	font-size: calc(var(--dv-btn-size) * 0.3);
	line-height: 1;
	pointer-events: none;
	position: relative;
	z-index: 2;
}

/* per-side identity */
.dv-half--l .dv-btn {
	--hot: var(--dv-left-hot);
	--hi: var(--dv-left-hi);
	--lo: var(--dv-left-lo);
	--edge: var(--dv-left-border);
	--ink: var(--dv-left-ink);
}
.dv-half--r .dv-btn {
	--hot: var(--dv-right-hot);
	--hi: var(--dv-right-hi);
	--lo: var(--dv-right-lo);
	--edge: var(--dv-right-border);
	--ink: var(--dv-right-ink);
}

/* Echo direction: a solid white circle offset INWARD (away from the resting thumb at
 * the pad's outer-bottom), so the echo survives occlusion. Per-button vector. */
.dv-btn[data-btn="up"] {
	--dv-echo-x: 0px;
	--dv-echo-y: 12px;
}
.dv-btn[data-btn="down"] {
	--dv-echo-x: 0px;
	--dv-echo-y: -12px;
}
.dv-half--l .dv-btn[data-btn="left"] {
	--dv-echo-x: 12px;
	--dv-echo-y: 0px;
}
.dv-half--l .dv-btn[data-btn="right"] {
	--dv-echo-x: 12px;
	--dv-echo-y: 0px;
}
.dv-half--r .dv-btn[data-btn="left"] {
	--dv-echo-x: -12px;
	--dv-echo-y: 0px;
}
.dv-half--r .dv-btn[data-btn="right"] {
	--dv-echo-x: -12px;
	--dv-echo-y: 0px;
}

/* layered pseudo-elements: ::before = white echo, ::after = occlusion bloom ring */
.dv-btn::before {
	content: "";
	position: absolute;
	inset: 14px; /* matches the hit-target padding — aligns with the visible circle */
	border-radius: 50%;
	background: #fff;
	opacity: 0;
	transform: translate(var(--dv-echo-x), var(--dv-echo-y));
	z-index: 0;
	transition: opacity 60ms linear;
}
.dv-btn::after {
	content: "";
	position: absolute;
	inset: -22%;
	border-radius: 50%;
	background: radial-gradient(closest-side, var(--hot) 0%, transparent 70%);
	opacity: 0;
	z-index: 0;
	pointer-events: none;
}

/* idle: dim translucent gradient + low-alpha border (sketch lines 24–25) */
.dv-btn {
	color: color-mix(in srgb, var(--hi) 70%, transparent);
	background-image: linear-gradient(
		180deg,
		color-mix(in srgb, var(--hot) 16%, transparent),
		color-mix(in srgb, var(--hot) 6%, transparent)
	);
	box-shadow: inset 0 0 0 var(--dv-ring-w, 4px)
		color-mix(in srgb, var(--hot) 55%, transparent);
}

/* lit: hot gradient fill, pale border, size bump, echo on, bloom in — the signal is the
 * LUMINANCE JUMP + echo shape; it must survive every palette.
 *
 * Center-only signal (7.7, owner call 2026-07-17): with `data-indicator="center"` on the
 * stage, the PAD keeps its idle look while lit — the seam miniature is the only prompt
 * (read the middle, answer at the edges). CSS-only suppression: `data-state` still flips
 * on the pad (hot path + pad↔mirror sync untouched), and the hit/wrong/miss flashes
 * below stay pad-side in both modes — they are feedback about the tap, not a prompt. */
.dv-stage:not([data-indicator="center"]) .dv-pad .dv-btn[data-state="lit"],
.dv-mirror .dv-btn[data-state="lit"] {
	background-image: linear-gradient(180deg, var(--hi) 0%, var(--hot) 60%, var(--lo)
		100%);
	box-shadow: inset 0 0 0 var(--dv-ring-w, 4px) var(--edge);
	color: var(--ink);
	transform: scale(1.09);
	transition: transform var(--dv-lit-in-ms) ease-out;
}
.dv-stage:not([data-indicator="center"]) .dv-pad .dv-btn[data-state="lit"]::before,
.dv-mirror .dv-btn[data-state="lit"]::before {
	opacity: 1;
}
.dv-stage:not([data-indicator="center"]) .dv-pad .dv-btn[data-state="lit"]::after,
.dv-mirror .dv-btn[data-state="lit"]::after {
	animation: dv-bloom-in var(--dv-lit-in-ms) ease-out forwards;
}

/* hit: white pop that settles */
.dv-btn[data-state="hit"] {
	animation: dv-hit 180ms ease-out;
}
.dv-btn[data-state="hit"]::after {
	animation: dv-bloom-out 180ms ease-out;
}

/* wrong: shake + dark flash (shape/motion carries the negative signal — never hue alone) */
.dv-btn[data-state="wrong"] {
	animation: dv-wrong 220ms ease-out;
}

/* miss: deflate + dim fizzle */
.dv-btn[data-state="miss"] {
	animation: dv-fizzle 260ms ease-in;
}

@keyframes dv-bloom-in {
	from {
		opacity: 0;
		transform: scale(0.6);
	}
	to {
		opacity: 0.55;
		transform: scale(1);
	}
}
@keyframes dv-bloom-out {
	from {
		opacity: 0.55;
		transform: scale(1);
	}
	to {
		opacity: 0;
		transform: scale(1.35);
	}
}
@keyframes dv-hit {
	0% {
		filter: brightness(2.2);
		transform: scale(1.16);
	}
	100% {
		filter: brightness(1);
		transform: scale(1);
	}
}
@keyframes dv-wrong {
	0%,
	100% {
		transform: translateX(0);
		filter: brightness(0.7);
	}
	25% {
		transform: translateX(-6px);
	}
	50% {
		transform: translateX(5px);
	}
	75% {
		transform: translateX(-3px);
	}
}
@keyframes dv-fizzle {
	0% {
		transform: scale(1.06);
		opacity: 1;
		filter: brightness(1.4);
	}
	100% {
		transform: scale(0.94);
		opacity: 0.55;
		filter: brightness(0.6);
	}
}

/* --- signal mirrors ------------------------------------------------------------------ */
/* Non-interactive miniature of each pad at the top-INNER corner of its half, flanking
 * the HUD. On-device finding (2026-07-16): a gripping thumb hides the whole lit button —
 * the echo/bloom above survive a fingertip, not the grip. The mirror relocates the
 * readable signal to the seam area where the eyes park; the real pad keeps lighting for
 * desktop and onboarding. Cells are `.dv-btn` miniatures driven by the SAME `data-state`
 * flips, so every state (lit/hit/wrong/miss) and every theme survives here for free.
 * With the center-only signal (7.7) the pad's lit visuals are suppressed and this
 * miniature becomes the SOLE prompt — the size bump below carries that load. */
.dv-mirror {
	position: absolute;
	top: var(--dv-mirror-inset-y);
	inline-size: var(--dv-mirror-size);
	aspect-ratio: 1;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: repeat(3, 1fr);
	place-items: center;
	pointer-events: none;
	/* miniaturize the shared button system through its own custom properties */
	--dv-btn-size: calc(var(--dv-mirror-size) * 0.3);
	--dv-ring-w: 2px;
}
.dv-half--l .dv-mirror {
	right: var(--dv-mirror-inset-x);
}
.dv-half--r .dv-mirror {
	left: var(--dv-mirror-inset-x);
}
.dv-mirror .dv-btn {
	cursor: default;
	/* no invisible hit-target ring: mirrors take no input */
	margin: 0;
	padding: 0;
}
/* the white anti-occlusion echo is noise on an unoccluded mirror */
.dv-mirror .dv-btn::before {
	content: none;
}
/* Center-only signal: the miniature is the sole stimulus — trade some of its discreet
 * flanking size for legibility. The var override re-derives box AND cells together. */
.dv-stage[data-indicator="center"] .dv-mirror {
	--dv-mirror-size: clamp(76px, 24vh, 152px);
}

/* --- overlays ----------------------------------------------------------------------- */
.dv-overlay {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	background: color-mix(in srgb, var(--dv-bg) 82%, transparent);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	z-index: 8;
}
.dv-overlay[hidden] {
	display: none;
}
.dv-card {
	text-align: center;
	padding: 28px 40px;
	border-radius: 18px;
	background: var(--d-color-surface, #1c1a24);
	border: 1px solid var(--d-color-border, #2c2938);
	max-width: min(420px, 86vw);
}
.dv-card h2 {
	margin: 0 0 8px;
	font-size: 22px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
/* 0–5 grade on the results card — THE verdict (the composite score is recorded but
 * never displayed): diamonds, never a bare color-only signal — the filled/hollow SHAPE
 * carries it. */
.dv-grade {
	font-size: clamp(26px, 7vh, 38px);
	letter-spacing: 0.22em;
	margin: 6px 0 4px;
}
.dv-grade-on {
	background: linear-gradient(90deg, var(--dv-left-hot), var(--dv-right-hot));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.dv-grade-off {
	opacity: 0.3;
}
/* With the composite score gone, the stat lines ARE the readout — a notch louder. */
.dv-done-detail {
	margin: 6px 0 10px;
	opacity: 0.85;
	font-size: 15px;
}
.dv-cta {
	font: inherit;
	font-weight: 800;
	letter-spacing: 0.03em;
	padding: 12px 28px;
	border: 0;
	border-radius: 999px;
	color: var(--dv-left-ink);
	background: linear-gradient(90deg, var(--dv-left-hot), var(--dv-right-hot));
	cursor: pointer;
}
.dv-cta:active {
	transform: scale(0.97);
}

/* --- shell screens ------------------------------------------------------------------ */
.dv-screen {
	z-index: 10;
}
.dv-card--title {
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: center;
	/* the mode grid made the card taller — never overflow a short landscape phone */
	max-height: 92vh;
	overflow-y: auto;
}
.dv-wordmark {
	margin: 0;
	font-size: clamp(34px, 10vh, 56px);
	font-weight: 800;
	letter-spacing: 0.14em;
}
.dv-wordmark span:first-child {
	color: var(--dv-left-hot);
}
.dv-wordmark span:last-child {
	color: var(--dv-right-hot);
}
.dv-tagline {
	margin: 0 0 6px;
	opacity: 0.75;
	font-size: 14px;
}
.dv-row {
	font: inherit;
	color: inherit;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	width: 100%;
	/* game.css has no global border-box reset — keep the padding + border inside
	   the 100% width so the row can't spill past the card's scroll box (the card's
	   overflow-y:auto forces overflow-x to auto, turning any spill into a scrollbar). */
	box-sizing: border-box;
	padding: 10px 14px;
	border: 1px solid var(--d-color-border, #2c2938);
	border-radius: 12px;
	background: var(--d-color-input, rgba(255, 255, 255, 0.04));
	cursor: pointer;
	text-align: center;
}

/* Title mode cards (7.3): the named-preset language — the last-picked card wears the
 * CTA gradient (it IS the Play button now). Compact 2×2: landscape height is scarce. */
.dv-modes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	width: 100%;
}
.dv-mode {
	position: relative; /* anchors the .dv-lock glyph */
	font: inherit;
	color: inherit;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1px;
	padding: 8px 10px;
	border: 1px solid var(--d-color-border, #2c2938);
	border-radius: 12px;
	background: var(--d-color-input, rgba(255, 255, 255, 0.04));
	cursor: pointer;
	text-align: center;
}
.dv-mode > span:first-child {
	font-weight: 800;
	letter-spacing: 0.03em;
	font-size: 14px;
}
.dv-mode:active {
	transform: scale(0.97);
}
.dv-mode.dv-mode-active {
	border-color: transparent;
	background: linear-gradient(90deg, var(--dv-left-hot), var(--dv-right-hot));
	color: var(--dv-left-ink);
}
.dv-mode.dv-mode-active .dv-row-sub {
	opacity: 0.8;
}

/* Round-length pills (30/60/120s) — small, one row under the mode grid. */
.dv-durations {
	display: flex;
	gap: 8px;
	justify-content: center;
}
.dv-durations button {
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	color: inherit;
	padding: 5px 14px;
	border: 1px solid var(--d-color-border, #2c2938);
	border-radius: 999px;
	background: transparent;
	cursor: pointer;
	opacity: 0.75;
}
.dv-durations button.dv-dur-active {
	opacity: 1;
	border-color: var(--d-color-foreground, #f1f0f5);
}
.dv-row--split {
	flex-direction: row;
	justify-content: space-between;
	cursor: default;
}
.dv-row--stack {
	cursor: default;
}
.dv-row-sub {
	font-size: 12px;
	opacity: 0.65;
}
.dv-locked {
	opacity: 0.55;
}
.dv-card--list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-height: 88vh;
	overflow-y: auto;
	min-width: min(360px, 84vw);
}
.dv-title-foot {
	display: flex;
	align-items: center;
	gap: 14px;
}
.dv-kbd-hint {
	font-size: 11px;
	opacity: 0.5;
}
@media (pointer: coarse) {
	.dv-kbd-hint {
		display: none;
	}
}
.dv-ghost {
	font: inherit;
	font-weight: 600;
	color: inherit;
	padding: 8px 16px;
	border: 1px solid var(--d-color-border, #2c2938);
	border-radius: 999px;
	background: transparent;
	cursor: pointer;
	opacity: 0.9;
}
.dv-btn-row {
	display: flex;
	gap: 10px;
	justify-content: center;
	margin-top: 14px;
}
.dv-best-line {
	margin: 8px 0 0;
	font-weight: 700;
	font-size: 14px;
}
.dv-best-line.dv-newbest {
	background: linear-gradient(90deg, var(--dv-left-hot), var(--dv-right-hot));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.dv-streak-line {
	margin: 4px 0 0;
	font-size: 13px;
	opacity: 0.85;
	min-height: 1.2em;
}
/* free-to-try standing on the results card — informative, never alarming */
.dv-cap-line {
	margin: 8px 0 0;
	font-size: 13px;
	opacity: 0.8;
}
.dv-nudge {
	margin-top: 10px;
}
.dv-themes {
	display: flex;
	gap: 10px;
	justify-content: center;
	margin-top: 6px;
}
.dv-themes button {
	position: relative;
	border: 2px solid transparent;
	border-radius: 10px;
	background: transparent;
	padding: 3px;
	cursor: pointer;
}
.dv-themes button.dv-theme-active {
	border-color: var(--d-color-foreground, #f1f0f5);
}
.dv-swatch {
	display: block;
	width: 44px;
	height: 28px;
	border-radius: 6px;
	background: linear-gradient(90deg, var(--a) 0 50%, var(--b) 50% 100%);
}
.dv-lock {
	position: absolute;
	right: -4px;
	top: -6px;
	font-size: 12px;
	font-style: normal;
}
.dv-about {
	font-size: 11px;
	opacity: 0.6;
	margin: 6px 0 0;
	word-break: break-all;
}
.dv-about code {
	font-size: 10px;
}
.dv-links {
	font-size: 12px;
	margin: 0;
}
.dv-links a {
	color: inherit;
}
.dv-tuning-wrap {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: center;
	max-height: 94vh;
}
.dv-preset-strip {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	justify-content: center;
	font-size: 12px;
}
.dv-preset-strip select,
.dv-preset-strip input {
	font: inherit;
	color: inherit;
	padding: 6px 8px;
	background: var(--d-color-input, rgba(255, 255, 255, 0.06));
	border: 1px solid var(--d-color-border, #2c2938);
	border-radius: 7px;
	max-width: 130px;
}
.dv-cta[href] {
	text-decoration: none;
	display: inline-block;
}

/* pause card: hint vs resuming states */
.dv-pause-exit {
	margin-top: 14px;
}
.dv-pause .dv-pause-resuming {
	display: none;
}
.dv-pause[data-resuming] .dv-pause-hint {
	display: none;
}
.dv-pause[data-resuming] .dv-pause-resuming {
	display: block;
	animation: dv-pulse 700ms ease-in-out infinite alternate;
}
@keyframes dv-pulse {
	from {
		opacity: 0.55;
	}
	to {
		opacity: 1;
	}
}

/* --- rotate-to-landscape notice ------------------------------------------------------ */
/* Coarse pointers only: desktop dev (fine pointer, any window shape) is never blocked.
 * iOS ignores the PWA manifest orientation — on iOS web this overlay (+ the runtime
 * pause) IS the landscape lock. */
.dv-rotate {
	display: none;
}
@media (orientation: portrait) and (pointer: coarse) {
	.dv-rotate {
		display: grid;
		place-items: center;
		position: fixed;
		inset: 0;
		z-index: 20;
		background: var(--dv-bg);
		text-align: center;
	}
}
.dv-rotate-card {
	max-width: 30ch;
	font-size: 17px;
	line-height: 1.5;
	opacity: 0.9;
}
.dv-rotate-icon {
	font-size: 56px;
	margin-bottom: 12px;
	animation: dv-rotate-hint 1.6s ease-in-out infinite;
}
@keyframes dv-rotate-hint {
	0%,
	100% {
		transform: rotate(0deg);
	}
	50% {
		transform: rotate(90deg);
	}
}

/* --- reduced motion ------------------------------------------------------------------ */
/* Drop decorative motion (shake, pulses, hints) — NEVER the luminance jump: the lit
 * state is gameplay signal, not ornament. */
@media (prefers-reduced-motion: reduce) {
	.dv-btn[data-state="wrong"] {
		animation: none;
		filter: brightness(0.7);
	}
	.dv-btn[data-state="hit"] {
		animation: none;
	}
	.dv-btn[data-state="miss"] {
		animation: none;
		opacity: 0.55;
	}
	.dv-btn[data-state="lit"] {
		transition: none;
	}
	.dv-rotate-icon {
		animation: none;
	}
	.dv-pause[data-resuming] .dv-pause-resuming {
		animation: none;
	}
}
