/* =============================================================================
   Hunt: Showdown · Sound Trainer
   Design system — mockup palette: night-blue base (#00050f), mint-teal
   interactions, old-gold rewards, serif small-caps display headings.
   Reference swatches sampled from the mockup: bg rgb(0,5,15), mint
   rgb(65,219,188), gold rgb(184,145,62), brick rgb(122,34,33),
   purple rgb(122,25,142).
   ============================================================================= */

:root {
	/* Layout */
	--topbar-h:   48px;
	--sidebar-w:  220px;

	/* Surfaces (night blue — the mockup base, darker than the old prod navy) */
	--bg:         #00050f;
	--bg-deep:    #000308;
	--surface:    #061019;
	--surface-2:  #0a1722;
	--surface-3:  #102230;
	--border:     rgba(255, 255, 255, 0.06);
	--border-hi:  rgba(65, 219, 188, 0.35);

	/* Text */
	--text:        #dfe4ea;
	--text-strong: #ffffff;
	--text-muted:  #93a2b1;
	--text-dim:    #5a6678;

	/* Mint-teal accent — interactive elements (buttons, focus, progress) */
	--accent:      #2ec7a5;
	--accent-hi:   #41dbbc;
	--accent-dim:  #1f8a73;
	--accent-glow: rgba(65, 219, 188, 0.14);

	/* Old gold — rewards, records, display titles (distinct from accent) */
	--gold:        #b8913e;
	--gold-hi:     #d8b96a;
	--gold-dim:    #8a6c2e;
	--gold-glow:   rgba(184, 145, 62, 0.15);

	/* Semantics (brick red lightened for legible text; pure swatch in -dim) */
	--success:     #35b87b;
	--success-dim: rgba(53, 184, 123, 0.16);
	--danger:      #b04a44;
	--danger-dim:  rgba(122, 34, 33, 0.28);

	/* Comparison slots (1-4) — mockup hues, lightened where needed for bars */
	--slot-1: #41dbbc;
	--slot-2: #b8913e;
	--slot-3: #9a3fb3;
	--slot-4: #b04a44;

	/* Caliber palette — used as TEXT color in small caps, no big badges */
	--ammo-compact: #4dabf7;
	--ammo-medium:  #ff922b;
	--ammo-long:    #fa5252;
	--ammo-special-long: #e8590c; /* patch 2.8: Mosin/Krag/Lebel/Berthier families */
	--ammo-shotgun: #51cf66;
	--ammo-special: #cc5de8;

	/* Geometry */
	--radius-sm:   4px;
	--radius:      8px;
	--radius-lg:   12px;

	/* Shadows */
	--shadow-sm:   0 2px 8px rgba(0, 0, 0, 0.4);
	--shadow:      0 12px 30px rgba(0, 0, 0, 0.55);

	/* Typography */
	--font-serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
	--font-sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-mono:  ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;

	/* Layout */
	--container-max: 920px;
}

/* ---------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ---------------------------------------------------------------- Accessibility helpers */
.sr-only {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.skip-link {
	position: absolute;
	top: -100px;
	left: 8px;
	z-index: 9999;
	padding: 0.5rem 0.85rem;
	background: var(--accent);
	color: var(--bg-deep);
	font-weight: 700;
	border-radius: var(--radius-sm);
	text-decoration: none;
	transition: top 0.15s ease;
}
.skip-link:focus {
	top: 8px;
	outline: 2px solid var(--text-strong);
	outline-offset: 2px;
}

/* Honor the user's motion preferences across the whole UI. */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
	html { scroll-behavior: auto; }
}

body {
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.55;
	color: var(--text);
	background-color: var(--bg);
	min-height: 100vh;
}

/* Global custom scrollbar — applies to <html> (page scroll) and any scrollable
   element by default. Slim, teal-tinted, transparent track. */
html {
	scrollbar-width: thin;
	scrollbar-color: rgba(65, 219, 188, 0.35) transparent;
}
*::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}
*::-webkit-scrollbar-track {
	background: transparent;
}
*::-webkit-scrollbar-thumb {
	background: rgba(65, 219, 188, 0.30);
	border-radius: 5px;
	border: 2px solid transparent;
	background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
	background: rgba(65, 219, 188, 0.55);
	background-clip: padding-box;
	border: 2px solid transparent;
}
*::-webkit-scrollbar-corner {
	background: transparent;
}

button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover, a:focus-visible { color: var(--accent-hi); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Headings receive programmatic focus for screen readers (panel() focuses the
   page h1) — never draw the interactive focus ring on them. */
h1[tabindex="-1"]:focus, h1[tabindex="-1"]:focus-visible { outline: none; }

::selection { background: var(--accent-glow); color: var(--text-strong); }

/* ---------------------------------------------------------------- Typography */
h1, h2, h3 {
	font-family: var(--font-serif);
	font-weight: 500;
	letter-spacing: 0.01em;
	color: var(--text-strong);
	line-height: 1.2;
}
h1 { font-size: clamp(1.85rem, 3.2vw, 2.6rem); margin-bottom: 0.5rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

.smallcaps {
	font-family: var(--font-sans);
	font-size: 0.72rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--text-muted);
	font-weight: 600;
}

.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }

/* ---------------------------------------------------------------- Display titles
   Gold serif small-caps headings — the "engraved contract" look. Use
   .display-title on the page h1/h2 of hero screens (quiz picker, report);
   .panel-title on card/section headers; .kbd for keyboard hints. */
.display-title {
	font-family: var(--font-serif);
	font-variant: small-caps;
	font-weight: 500;
	letter-spacing: 0.08em;
	line-height: 1.15;
	color: var(--gold-hi);
}
.display-title--xl { font-size: clamp(2rem, 4vw, 2.9rem); }
.display-sub {
	font-size: 0.8rem;
	letter-spacing: 0.26em;
	text-transform: uppercase;
	color: var(--text-muted);
}
/* Centered ornament divider: —————◆————— */
.display-ornament {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	color: var(--gold-dim);
	margin: 0.6rem 0;
}
.display-ornament::before,
.display-ornament::after {
	content: "";
	width: 64px;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--gold-dim));
}
.display-ornament::after { background: linear-gradient(90deg, var(--gold-dim), transparent); }

.panel-title {
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--text-muted);
}
.panel-title--gold { color: var(--gold); }

.kbd {
	display: inline-block;
	min-width: 1.5em;
	padding: 0.05rem 0.4rem;
	border: 1px solid var(--border);
	border-bottom-width: 2px;
	border-radius: 4px;
	background: var(--surface-3);
	color: var(--text);
	font-family: var(--font-mono);
	font-size: 0.72rem;
	line-height: 1.4;
	text-align: center;
}

/* ---------------------------------------------------------------- Shared components (design system)
   Generic building blocks reused across quiz config, library and compare:
   .seg (segmented control) · .switch (on/off toggle) · .chip (filter pill)
   .bar (stat/progress bar) · .ring (SVG progress ring) · .badge-gold
   .sticky-bar (floating action bar) · .card--selected (teal glow). */
.seg {
	display: inline-flex;
	gap: 2px;
	padding: 3px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 999px;
}
.seg-btn {
	padding: 0.32rem 1.1rem;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--text-muted);
	transition: background 0.15s ease, color 0.15s ease;
}
.seg-btn:hover { color: var(--text-strong); }
.seg-btn.is-on { background: var(--accent); color: var(--bg-deep); }

.switch {
	position: relative;
	flex: 0 0 auto;
	width: 34px;
	height: 18px;
	border-radius: 999px;
	background: var(--surface-3);
	border: 1px solid var(--border);
	transition: background 0.15s ease, border-color 0.15s ease;
}
.switch::after {
	content: "";
	position: absolute;
	top: 1px; left: 1px;
	width: 14px; height: 14px;
	border-radius: 50%;
	background: var(--text-muted);
	transition: transform 0.15s ease, background 0.15s ease;
}
.switch.is-on { background: var(--accent-dim); border-color: var(--border-hi); }
.switch.is-on::after { transform: translateX(16px); background: var(--text-strong); }

/* .chip lives in the "Filter chips" section below; `.is-on` is the modern
   alias of `.active` (both styled there). Gold variant for reward filters: */
.chip.is-on--gold {
	border-color: rgba(184, 145, 62, 0.45);
	background: var(--gold-glow);
	color: var(--gold-hi);
}

.bar {
	height: 6px;
	border-radius: 3px;
	background: var(--surface-3);
	overflow: hidden;
}
.bar-fill {
	height: 100%;
	border-radius: inherit;
	background: var(--accent);
	transition: width 0.3s ease;
}
.bar-fill--gold   { background: var(--gold); }
.bar-fill--danger { background: var(--danger); }
.bar-fill--slot-1 { background: var(--slot-1); }
.bar-fill--slot-2 { background: var(--slot-2); }
.bar-fill--slot-3 { background: var(--slot-3); }
.bar-fill--slot-4 { background: var(--slot-4); }

/* SVG progress ring — markup: <svg class="ring"><circle class="ring-track"/>
   <circle class="ring-value"/></svg> + JS sets stroke-dashoffset. */
.ring { transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--surface-3); }
.ring-value {
	fill: none;
	stroke: var(--accent);
	stroke-linecap: round;
	transition: stroke-dashoffset 0.4s ease;
}
.ring-value--gold { stroke: var(--gold); }

.badge-gold {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.18rem 0.6rem;
	border: 1px solid rgba(184, 145, 62, 0.45);
	border-radius: 999px;
	background: var(--gold-glow);
	color: var(--gold-hi);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	white-space: nowrap;
}

.sticky-bar {
	position: fixed;
	left: 50%;
	bottom: 1rem;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.6rem 1rem;
	background: var(--surface-2);
	border: 1px solid var(--border-hi);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
	z-index: 90;
	max-width: calc(100vw - 2rem);
}

.card--selected {
	border-color: var(--border-hi) !important;
	box-shadow: 0 0 0 1px var(--border-hi), 0 0 18px var(--accent-glow);
}

/* ---------------------------------------------------------------- Layout */
.page {
	max-width: var(--container-max);
	margin: 0 auto;
	padding: calc(var(--topbar-h) + 1.5rem) 1.25rem 2rem;
}
/* Stretch the page to use the full available width (minus the sidebar on
   desktop) on:
   - the Cards library view (more weapons per row)
   - the quiz-playing view (more guess cards per row, much better at full size) */
.page:has(.weapon-list[data-view="cards"]),
.page:has(.guess-grid) {
	max-width: none;
	padding-left: 2rem;
	padding-right: 2rem;
}

.section {
	margin-top: 2.5rem;
}
.section-heading {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1rem;
}
.section-heading::before,
.section-heading::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--border);
}
.section-heading > span {
	color: var(--text-muted);
	font-size: 0.78rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
}

.intro {
	color: var(--text-muted);
	max-width: 620px;
	margin: 0.25rem 0 1.5rem;
	font-size: 1.02rem;
}

.panel {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 1.5rem;
}
@media (min-width: 768px) {
	.panel { padding: 2rem; }
}

/* ---------------------------------------------------------------- Top bar */
.topbar {
	position: fixed;
	top: 0; left: 0; right: 0;
	height: var(--topbar-h);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.75rem;
	padding: 0 0.85rem;
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	z-index: 100;
	/* Intentionally no backdrop-filter: it would create a containing block
	   that traps the position:fixed .vertical-menu inside the topbar. */
}
.topbar-left   { display: flex; align-items: center; gap: 0.5rem; flex: 0 0 auto; }
.topbar-right  { display: flex; align-items: center; gap: 0.5rem; flex: 0 0 auto; }
.topbar-center { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; }

/* Contextual content */
.topbar-search {
	width: 100%;
	max-width: 420px;
	padding: 0.4rem 0.85rem;
	font: inherit;
	color: var(--text);
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: border-color 0.15s ease, background 0.15s ease;
}
.topbar-search:hover { border-color: var(--border-hi); }
.topbar-search:focus-visible {
	outline: none;
	border-color: var(--accent);
	background: var(--surface-3);
}
.topbar-title {
	font-family: var(--font-serif);
	font-size: 1.15rem;
	color: var(--text-strong);
	letter-spacing: 0.01em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.topbar-quiz {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	max-width: 100%;
	overflow: hidden;
}
.topbar-quiz .mode-pill {
	display: inline-block;
	padding: 0.15rem 0.55rem;
	border-radius: 999px;
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	background: var(--surface-3);
	color: var(--accent);
	border: 1px solid var(--accent-dim);
	flex: 0 0 auto;
}
.topbar-quiz .mode-pill[data-mode="marathon"] {
	color: var(--danger);
	border-color: rgba(220, 53, 69, 0.45);
	background: rgba(220, 53, 69, 0.10);
}
.topbar-quiz .mode-pill[data-mode="mixed"],
.topbar-quiz .mode-pill[data-mode="daily"] {
	color: #cc5de8;
	border-color: rgba(204, 93, 232, 0.45);
	background: rgba(204, 93, 232, 0.10);
}
.topbar-quiz-label {
	color: var(--text-muted);
	font-size: 0.9rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex: 1 1 auto;
}
.topbar-quit {
	padding: 0.3rem 0.7rem;
	border: 1px solid var(--border-hi);
	border-radius: var(--radius);
	color: var(--text-muted);
	background: transparent;
	font-size: 0.82rem;
	flex: 0 0 auto;
	transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

/* Timer pill in the topbar — used by Speed / Time Attack / Blitz / Speedrun */
.topbar-timer {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.7rem;
	border-radius: 999px;
	font-family: var(--font-mono);
	font-variant-numeric: tabular-nums;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--accent);
	background: var(--surface-3);
	border: 1px solid var(--accent-dim);
	min-width: 64px;
	justify-content: center;
	flex: 0 0 auto;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.topbar-timer.penalty {
	animation: timerShake 0.4s ease;
}
@keyframes timerShake {
	0%, 100% { background: var(--surface-3); }
	50% {
		background: rgba(220, 53, 69, 0.25);
		color: var(--danger);
		border-color: var(--danger);
		transform: scale(1.05);
	}
}
.penalty-flash {
	position: absolute;
	margin-left: 4px;
	color: var(--danger);
	font-weight: 700;
	font-size: 0.85rem;
	animation: flashUp 1.1s ease forwards;
	pointer-events: none;
}
@keyframes flashUp {
	0%   { opacity: 0; transform: translateY(0); }
	20%  { opacity: 1; transform: translateY(-4px); }
	100% { opacity: 0; transform: translateY(-20px); }
}

/* Blitz per-weapon countdown bar shown under the play stage */
.blitz-bar-wrap {
	margin-top: 1rem;
	height: 6px;
	background: var(--surface-2);
	border-radius: 3px;
	overflow: hidden;
	width: 100%;
	max-width: 320px;
	margin-left: auto;
	margin-right: auto;
}
.blitz-bar {
	height: 100%;
	background: linear-gradient(90deg, var(--danger), var(--gold), var(--accent));
	transition: width 0.08s linear;
}
.topbar-quit:hover {
	color: var(--danger);
	border-color: var(--danger);
	background: rgba(220, 53, 69, 0.08);
}

/* Settings gear */
.settings-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px; height: 34px;
	border-radius: var(--radius);
	color: var(--text-muted);
	background: transparent;
	transition: background-color 0.15s ease, color 0.15s ease;
}
.settings-toggle:hover { background: var(--surface-2); color: var(--text); }
.settings-toggle svg { width: 18px; height: 18px; }

@media (max-width: 600px) {
	.topbar-title { font-size: 1rem; }
	.topbar-quiz-label { font-size: 0.8rem; }
	.topbar-search { max-width: none; }
}

/* ---------------------------------------------------------------- Dev badge */
.dev-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	background: rgba(184, 145, 62, 0.15);
	border: 1px solid rgba(184, 145, 62, 0.5);
	color: var(--gold);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.15em;
	text-decoration: none;
	transition: background 0.15s ease;
}
.dev-badge:hover { background: rgba(184, 145, 62, 0.28); color: var(--gold); }

/* ---------------------------------------------------------------- Menu */
.menu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px; height: 34px;
	border-radius: var(--radius);
	color: var(--text);
	transition: background-color 0.15s ease;
}
.menu-toggle:hover,
.menu-toggle:focus-visible { background: var(--surface-2); }
.menu-toggle svg { width: 18px; height: 18px; }

.vertical-menu {
	position: fixed;
	top: var(--topbar-h);
	bottom: 0;
	left: -260px;
	width: 260px;
	background: var(--surface);
	border-right: 1px solid var(--border);
	padding: 1rem 0.85rem;
	transition: left 0.3s ease;
	z-index: 90;
	box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
	overflow-y: auto;
	overscroll-behavior: contain;

	/* Slim, almost-invisible scrollbar */
	scrollbar-width: thin;
	scrollbar-color: rgba(65, 219, 188, 0.25) transparent;
}
.vertical-menu::-webkit-scrollbar { width: 4px; }
.vertical-menu::-webkit-scrollbar-track { background: transparent; }
.vertical-menu::-webkit-scrollbar-thumb {
	background: rgba(65, 219, 188, 0.25);
	border-radius: 2px;
}
.vertical-menu::-webkit-scrollbar-thumb:hover {
	background: rgba(65, 219, 188, 0.5);
}
.vertical-menu.show { left: 0; }

/* Desktop: permanent sidebar that spans full height, topbar to the right of it. */
@media (min-width: 900px) {
	.menu-toggle,
	.menu-toggle-btn { display: none !important; }

	body {
		padding-left: var(--sidebar-w);
	}

	.vertical-menu {
		top: 0;
		left: 0;
		width: var(--sidebar-w);
		padding-top: 1rem;
		transition: none;
		box-shadow: none;
		border-right: 1px solid var(--border);
		z-index: 110;
	}

	.topbar {
		left: var(--sidebar-w);
	}
}
.vertical-menu a {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.7rem 0.9rem;
	margin-bottom: 0.2rem;
	border-radius: var(--radius);
	color: var(--text);
	font-size: 0.98rem;
	font-family: var(--font-sans);
	transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}
.vertical-menu a:hover {
	background: var(--surface-2);
	color: var(--text-strong);
	padding-left: 1.1rem;
}
.vertical-menu a.active {
	background: var(--accent-glow);
	color: var(--accent-hi);
	border-left: 3px solid var(--accent);
	padding-left: calc(0.9rem - 3px);
}
.vertical-menu a.active:hover {
	padding-left: calc(1.1rem - 3px);
}
.vertical-menu a .menu-icon {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	opacity: 0.85;
}
.vertical-menu a.active .menu-icon {
	opacity: 1;
}

/* ---------------------------------------------------------------- Language switcher */
.lang-switcher {
	position: relative;
}
.lang-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.3rem 0.65rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	color: var(--text);
	font-size: 0.82rem;
	background: var(--surface-2);
	transition: border-color 0.15s ease, background 0.15s ease;
}
.lang-toggle:hover { border-color: var(--border-hi); }
.lang-toggle svg { width: 14px; height: 14px; opacity: 0.7; }
.lang-menu {
	position: absolute;
	right: 0; top: calc(100% + 6px);
	min-width: 140px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 0.35rem;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s linear 0.15s;
}
.lang-switcher.open .lang-menu {
	opacity: 1; visibility: visible; transform: translateY(0);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
}
.lang-menu button {
	display: block;
	width: 100%;
	padding: 0.4rem 0.65rem;
	border-radius: var(--radius-sm);
	text-align: left;
	font-size: 0.85rem;
	color: var(--text);
}
.lang-menu button:hover { background: var(--surface-3); }
.lang-menu button.active { color: var(--accent); }

/* ---------------------------------------------------------------- Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.55rem 1.1rem;
	border-radius: var(--radius);
	border: 1px solid transparent;
	font-family: var(--font-sans);
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--text);
	background: var(--surface-2);
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
	white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-hi); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
	background: transparent;
	border-color: var(--border);
	color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-hi); background: var(--surface-2); }

.btn-primary {
	background: var(--accent);
	color: var(--bg-deep);
	font-weight: 600;
	border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); color: var(--bg-deep); }

.btn-lg { padding: 0.85rem 1.6rem; font-size: 1.05rem; }
.btn-xl { padding: 1rem 2rem; font-size: 1.15rem; }

.kbd {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	padding: 0.05rem 0.4rem;
	margin-left: 0.4rem;
	background: rgba(0, 0, 0, 0.4);
	border: 1px solid var(--border-hi);
	border-radius: 4px;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	color: var(--text-muted);
	font-weight: 500;
}
.btn-primary .kbd {
	background: rgba(0, 3, 8, 0.25);
	color: var(--bg-deep);
	border-color: rgba(0, 3, 8, 0.35);
}

/* ---------------------------------------------------------------- Form controls */
.field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}
.field label {
	font-size: 0.78rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-muted);
	font-weight: 600;
}
.input {
	width: 100%;
	padding: 0.55rem 0.85rem;
	border-radius: var(--radius);
	border: 1px solid var(--border);
	background: var(--surface-2);
	color: var(--text);
	transition: border-color 0.15s ease, background 0.15s ease;
}
.input:hover { border-color: var(--border-hi); }
.input:focus-visible {
	border-color: var(--accent);
	outline: none;
	background: var(--surface-3);
}
.input::placeholder { color: var(--text-dim); }

/* ---------------------------------------------------------------- Filter chips */
.chip-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}
.chip {
	padding: 0.4rem 0.85rem;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: transparent;
	color: var(--text-muted);
	font-size: 0.85rem;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip:hover { color: var(--text); border-color: var(--border-hi); }
.chip.active,
.chip.is-on {
	background: var(--accent-glow);
	color: var(--accent-hi);
	border-color: var(--accent-dim);
}
.chip[data-ammo="Compact"].active, .chip[data-ammo="Compact"].is-on { color: var(--ammo-compact); border-color: var(--ammo-compact); background: rgba(109, 176, 212, 0.12); }
.chip[data-ammo="Medium"].active,  .chip[data-ammo="Medium"].is-on  { color: var(--ammo-medium);  border-color: var(--ammo-medium);  background: rgba(212, 165, 116, 0.12); }
.chip[data-ammo="Long"].active,    .chip[data-ammo="Long"].is-on    { color: var(--ammo-long);    border-color: var(--ammo-long);    background: rgba(196, 115, 99, 0.12); }
.chip[data-ammo="Special Long"].active, .chip[data-ammo="Special Long"].is-on { color: var(--ammo-special-long); border-color: var(--ammo-special-long); background: rgba(232, 89, 12, 0.12); }
.chip[data-ammo="Shotgun"].active, .chip[data-ammo="Shotgun"].is-on { color: var(--ammo-shotgun); border-color: var(--ammo-shotgun); background: rgba(127, 166, 116, 0.12); }
.chip[data-ammo="Special"].active, .chip[data-ammo="Special"].is-on { color: var(--ammo-special); border-color: var(--ammo-special); background: rgba(177, 134, 204, 0.12); }

/* ---------------------------------------------------------------- Caliber label (TEXT, not badge) */
.caliber {
	font-size: 0.72rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	font-weight: 600;
}
.caliber[data-ammo="Compact"] { color: var(--ammo-compact); }
.caliber[data-ammo="Medium"]  { color: var(--ammo-medium);  }
.caliber[data-ammo="Long"]    { color: var(--ammo-long);    }
.caliber[data-ammo="Special Long"] { color: var(--ammo-special-long); }
.caliber[data-ammo="Shotgun"] { color: var(--ammo-shotgun); }
.caliber[data-ammo="Special"] { color: var(--ammo-special); }

/* ---------------------------------------------------------------- Home: weapon library */
.toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	align-items: flex-end;
	margin-bottom: 1.5rem;
}
.toolbar .field { flex: 0 0 auto; min-width: 240px; }
.toolbar .filters { flex: 1 1 auto; }

.count {
	color: var(--text-muted);
	font-size: 0.88rem;
}

.library-controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin: 0.5rem 0 1rem;
	flex-wrap: wrap;
}

/* View toggle */
.view-toggle {
	display: inline-flex;
	gap: 0.2rem;
	padding: 0.2rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}
.view-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 30px;
	border-radius: var(--radius-sm);
	color: var(--text-muted);
	transition: background 0.15s ease, color 0.15s ease;
}
.view-btn:hover { color: var(--text); background: var(--surface-2); }
.view-btn.active {
	background: var(--accent);
	color: var(--bg-deep);
}
.view-btn svg { width: 16px; height: 16px; }

/* Key stats pills used in the Cards view */
.key-stats {
	display: flex;
	gap: 0.4rem;
	flex-wrap: wrap;
	margin: 0.4rem 0;
}
.stat-pill {
	display: inline-flex;
	align-items: baseline;
	gap: 0.25rem;
	padding: 0.15rem 0.5rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: 0.78rem;
	font-variant-numeric: tabular-nums;
	color: var(--text);
}
.stat-pill .stat-label {
	color: var(--text-muted);
	font-size: 0.68rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* ============================================== Library — common */
.weapon-list[data-view="compact"] {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.weapon-list[data-view="cards"] {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* Shared: action columns at left and right of each table-like row */
.weapon-row-actions {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
}

/* + (compare) button — same shape as ⓘ */
.weapon-compare-btn {
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: var(--text-muted);
	background: transparent;
	border: 1px solid var(--border);
	transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
	flex-shrink: 0;
}
.weapon-compare-btn:hover { color: var(--accent); border-color: var(--accent-dim); background: var(--surface-3); }
.weapon-compare-btn.active {
	color: var(--bg-deep);
	background: var(--accent);
	border-color: var(--accent);
}
.weapon-compare-btn.active:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.weapon-compare-btn svg { width: 14px; height: 14px; }
/* Numbered slot badge once selected — slot colors come from --weapon-color. */
.weapon-compare-btn.active { padding: 0; }
.compare-slot-num {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: var(--weapon-color, var(--accent));
	color: var(--bg-deep);
	font-size: 0.8rem;
	font-weight: 800;
	line-height: 1;
}
.weapon-compare-btn.active { background: transparent; border-color: transparent; }
.weapon-compare-btn.active:hover { background: transparent; border-color: transparent; filter: brightness(1.15); }

/* Favorite star */
.weapon-fav-btn {
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: var(--text-muted);
	background: transparent;
	border: 1px solid var(--border);
	transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
	flex-shrink: 0;
}
.weapon-fav-btn:hover { color: var(--gold-hi); border-color: var(--gold-dim); background: var(--surface-3); }
.weapon-fav-btn.active { color: var(--gold); border-color: var(--gold-dim); background: var(--gold-glow); }
.weapon-fav-btn svg { width: 14px; height: 14px; }

.card-price {
	color: var(--gold-hi);
	font-size: 0.82rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	margin-left: 0.6rem;
}

/* The weapon name itself is clickable (replaces the old ⓘ button). */
.weapon-name-btn {
	display: block;
	width: 100%;
	background: none;
	border: none;
	padding: 0;
	text-align: left;
	font: inherit;
	color: inherit;
	cursor: pointer;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	transition: color 0.15s ease;
}
.weapon-name-btn:hover .name,
.weapon-name-btn:focus-visible .name {
	color: var(--accent);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}
.weapon-name-btn.inert {
	cursor: default;
}
.weapon-name-btn.inert:hover .name { color: inherit; text-decoration: none; }

.card-name-btn {
	background: none;
	border: none;
	padding: 0;
	text-align: left;
	font: inherit;
	color: inherit;
	cursor: pointer;
	transition: color 0.15s ease;
	width: 100%;
}
.card-name-btn:hover .card-name,
.card-name-btn:focus-visible .card-name { color: var(--accent); }
.card-name-btn.inert { cursor: default; }
.card-name-btn.inert:hover .card-name { color: var(--text-strong); }

/* ============================================== Library — Compact view */
/* Layout: [+] [clickable name + caliber] [distances] */
.weapon-row.compact {
	display: grid;
	grid-template-columns: 32px minmax(0, 280px) minmax(0, 1fr);
	gap: 0.5rem 0.85rem;
	align-items: center;
	padding: 0.55rem 0.75rem;
	border-radius: var(--radius);
	border: 1px solid transparent;
	background: var(--surface-2);
	transition: border-color 0.15s ease, background 0.15s ease;
}
.weapon-row.compact:hover { border-color: var(--border-hi); background: var(--surface-3); }
.weapon-row.compact .name {
	font-family: var(--font-serif);
	font-size: 1.1rem;
	color: var(--text-strong);
}
.weapon-row.compact .distances {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
	justify-content: flex-end;
}
@media (max-width: 700px) {
	.weapon-row.compact {
		grid-template-columns: 32px minmax(0, 1fr);
	}
	.weapon-row.compact .distances {
		grid-column: 1 / -1;
		justify-content: flex-start;
	}
}

/* ============================================== Library — Cards view */
.weapon-card {
	display: flex;
	flex-direction: column;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	cursor: pointer; /* the whole card is clickable → opens detail */
	transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.weapon-card:hover {
	border-color: var(--border-hi);
	transform: translateY(-2px);
	box-shadow: var(--shadow-sm);
}
/* Interactive children keep their own cursor (so users know what's truly
   clickable inside the broader card hit-zone). */
.weapon-card .distance-pill,
.weapon-card .weapon-compare-btn,
.weapon-card .card-name-btn,
.weapon-card .weapon-detail-btn { cursor: pointer; }
.weapon-card .card-image {
	position: relative;
	aspect-ratio: 16 / 9;
	background:
		radial-gradient(ellipse at center, var(--surface-3), var(--surface)),
		var(--surface);
	display: flex;
	align-items: center;
	justify-content: center;
	border-bottom: 1px solid var(--border);
}
.weapon-card .weapon-thumb.size-card {
	max-width: 80%;
	max-height: 82%;
	width: auto;
	height: auto;
	object-fit: contain;
	background: transparent;
	border: 0;
	padding: 0;
	filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}
.weapon-card .card-corner {
	position: absolute;
	top: 0.5rem;
	display: flex;
	gap: 0.3rem;
}
.weapon-card .card-corner.left  { left: 0.5rem; }
.weapon-card .card-corner.right { right: 0.5rem; }
.weapon-card .card-corner .weapon-compare-btn {
	background: rgba(0, 3, 8, 0.7);
	backdrop-filter: blur(4px);
	border-color: rgba(255, 255, 255, 0.08);
}
.weapon-card .card-corner .weapon-compare-btn.active {
	background: var(--accent);
	border-color: var(--accent);
}
.weapon-card .card-body {
	padding: 0.85rem 1rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}
.weapon-card .card-name {
	font-family: var(--font-serif);
	font-size: 1.2rem;
	color: var(--text-strong);
	margin: 0;
}
.weapon-card .card-meta { margin-top: -0.25rem; }
.weapon-card .distances {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
	margin-top: 0.25rem;
	justify-content: flex-end;
}

/* ============================================== Compare view */
/* Per-weapon color palette (max 4 weapons compared). */
[data-color-idx="0"] { --weapon-color: var(--slot-1); }  /* green */
[data-color-idx="1"] { --weapon-color: var(--slot-2); }  /* gold */
[data-color-idx="2"] { --weapon-color: var(--slot-3); }  /* purple */
[data-color-idx="3"] { --weapon-color: var(--slot-4); }  /* red */

.cmp-color-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--weapon-color);
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3) inset;
	flex-shrink: 0;
}

.cmp-toolbar {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.25rem;
	flex-wrap: wrap;
}
.cmp-toolbar h1 { margin: 0; flex: 0 0 auto; }
/* Detail mode = single weapon viewed alone. The header is just the weapon's
   name, slightly more prominent since there's no surrounding chrome. */
.cmp-toolbar.detail h1 { font-size: 2rem; }
.cmp-count {
	color: var(--text-muted);
	font-size: 0.9rem;
}
.cmp-clear { margin-left: auto; }

/* Weapons header — small tiles */
.cmp-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 0.85rem;
	margin-bottom: 2rem;
}
@media (min-width: 900px) {
	.cmp-tiles[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cmp-tiles[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.cmp-tiles[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.cmp-tile {
	position: relative;
	background: var(--surface);
	border: 1px solid var(--border);
	border-top: 3px solid var(--weapon-color);
	border-radius: var(--radius);
	padding: 0.85rem 0.85rem 0.65rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.cmp-remove {
	position: absolute;
	top: 0.4rem;
	right: 0.4rem;
	width: 24px; height: 24px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(0, 3, 8, 0.65);
	color: var(--text);
	font-size: 1rem;
	transition: background 0.15s ease, color 0.15s ease;
	z-index: 2;
}
.cmp-remove:hover { background: var(--danger); color: #fff; }
.cmp-tile-image {
	display: block;
	width: 100%;
	max-height: 100px;
	object-fit: contain;
	filter: drop-shadow(0 3px 10px rgba(0,0,0,0.4));
}
.cmp-tile-image.placeholder {
	height: 80px;
	background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 6px, var(--surface-2) 6px, var(--surface-2) 12px);
	border-radius: var(--radius-sm);
}
.cmp-tile-title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
}
.cmp-tile-name {
	font-family: var(--font-serif);
	font-size: 1.05rem;
	color: var(--text-strong);
	line-height: 1.15;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.cmp-tile-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
}
.cmp-tile-meta .meta-chip {
	padding: 0.1rem 0.4rem;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: 0.7rem;
	color: var(--text-muted);
}
.cmp-tile-meta .meta-chip.price {
	color: var(--gold);
	border-color: rgba(184, 145, 62, 0.4);
}
.cmp-tile-distances {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
}

/* Stat groups — 2-column grid for a denser presentation.
   Group title spans both columns; stat blocks fill in 2 cols underneath. */
.cmp-statgroups {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}
.cmp-group {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: 1.75rem;
	row-gap: 0.35rem;
}
.cmp-group h3 {
	grid-column: 1 / -1;
	font-size: 0.7rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--accent);
	font-weight: 700;
	margin-bottom: 0.25rem;
	font-family: var(--font-sans);
	padding-bottom: 0.25rem;
	border-bottom: 1px solid var(--border);
}
.cmp-stat-block {
	min-width: 0;
}
.cmp-stat-label {
	font-family: var(--font-sans);
	font-size: 0.75rem;
	color: var(--text-muted);
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin: 0 0 0.15rem;
	font-weight: 600;
}
.cmp-stat-hint {
	font-family: var(--font-sans);
	font-size: 0.6rem;
	color: var(--text-dim);
	font-weight: 400;
	letter-spacing: 0.04em;
	margin-left: 0.3rem;
	text-transform: none;
}
.cmp-bar-stack {
	display: flex;
	flex-direction: column;
	gap: 0.08rem;
}
.cmp-bar-row {
	display: grid;
	grid-template-columns: 8px minmax(0, 1fr) 2.6rem;
	gap: 0.4rem;
	align-items: center;
	font-size: 0.78rem;
	min-height: 14px;
}
.cmp-bar-row .cmp-color-dot {
	width: 7px;
	height: 7px;
	box-shadow: none;
}
.cmp-bar-track {
	height: 5px;
	background: var(--surface-2);
	border-radius: 3px;
	overflow: hidden;
	position: relative;
}
.cmp-bar-fill {
	height: 100%;
	width: 0%;
	background: var(--weapon-color);
	border-radius: 3px;
	transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cmp-bar-row.best .cmp-bar-fill {
	box-shadow: 0 0 6px color-mix(in srgb, var(--weapon-color) 60%, transparent);
}
.cmp-bar-row.best .cmp-bar-value::after {
	content: " ★";
	color: var(--gold);
	font-size: 0.65rem;
}
.cmp-bar-row.empty .cmp-bar-track {
	opacity: 0.35;
}
.cmp-bar-value {
	font-variant-numeric: tabular-nums;
	color: var(--text);
	font-weight: 600;
	text-align: right;
	font-size: 0.78rem;
}
.cmp-bar-row.best .cmp-bar-value {
	color: var(--text-strong);
}
.cmp-bar-value.muted { color: var(--text-dim); font-weight: 400; }

/* Stacked layout on narrow screens — single column. */
@media (max-width: 700px) {
	.cmp-group {
		grid-template-columns: 1fr;
		column-gap: 0;
	}
}

/* Floating "Compare N" chip on the home view */
.compare-chip {
	position: fixed;
	right: 1.5rem;
	bottom: 1.5rem;
	z-index: 80;
	display: inline-flex;
	align-items: stretch;
	background: var(--accent);
	color: var(--bg-deep);
	border-radius: 999px;
	font-weight: 700;
	font-size: 0.9rem;
	box-shadow: 0 8px 24px rgba(65, 219, 188, 0.35);
	animation: chipIn 0.25s ease;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	overflow: hidden;
}
.compare-chip:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(65, 219, 188, 0.45);
}
.compare-chip .cmp-chip-open {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.6rem 0.95rem 0.6rem 1.1rem;
	color: var(--bg-deep);
	text-decoration: none;
}
.compare-chip .cmp-chip-clear {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	padding: 0 0.85rem 0 0.55rem;
	background: transparent;
	border: 0;
	border-left: 1px solid rgba(0, 3, 8, 0.25);
	color: var(--bg-deep);
	font-size: 1.25rem;
	line-height: 1;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.12s ease;
}
.compare-chip .cmp-chip-clear:hover {
	background: rgba(0, 3, 8, 0.12);
}
.compare-chip svg { width: 16px; height: 16px; }
@keyframes chipIn {
	from { opacity: 0; transform: translateY(20px) scale(0.9); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================== Visual quiz */
.visual-prompt {
	font-size: 0.85rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--text-muted);
	margin-bottom: 0.75rem;
	font-weight: 600;
}
.visual-stage {
	background:
		radial-gradient(ellipse at center, var(--surface-3), var(--surface-2) 70%);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
}
.visual-image {
	max-width: 100%;
	max-height: 260px;
	object-fit: contain;
	filter: drop-shadow(0 4px 12px rgba(0,0,0,0.45));
}
.distance-pill {
	padding: 0.25rem 0.6rem;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text-muted);
	font-size: 0.82rem;
	font-variant-numeric: tabular-nums;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.distance-pill:hover { color: var(--text); border-color: var(--border-hi); }
.distance-pill.playing {
	background: var(--accent);
	color: var(--bg-deep);
	border-color: var(--accent);
}

.coming-soon-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.7rem;
	border-radius: var(--radius-sm);
	border: 1px dashed var(--border-hi);
	background: rgba(255, 255, 255, 0.02);
	color: var(--text-muted);
	font-size: 0.78rem;
	font-style: italic;
	letter-spacing: 0.02em;
	cursor: help;
	white-space: nowrap;
}
.weapon-row[data-name].soon,
.weapon-card[data-name].soon { opacity: 0.78; }

@media (max-width: 600px) {
	.weapon-row { grid-template-columns: 1fr; }
	.weapon-row .distances { justify-content: flex-start; }
}

/* ---------------------------------------------------------------- Quiz: mode cards */
.mode-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 0.85rem;
}
.mode-card {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1.25rem;
	border-radius: var(--radius);
	border: 1px solid var(--border);
	background: var(--surface-2);
	text-align: left;
	color: var(--text);
	transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
	position: relative;
	overflow: hidden;
}
.mode-card:hover { border-color: var(--border-hi); background: var(--surface-3); }
.mode-card.active {
	border-color: var(--accent);
	background:
		linear-gradient(180deg, rgba(212, 165, 116, 0.08), transparent 60%),
		var(--surface-3);
}
.mode-card .mode-name {
	font-family: var(--font-serif);
	font-size: 1.4rem;
	color: var(--text-strong);
}
.mode-card .mode-short {
	color: var(--text-muted);
	font-size: 0.92rem;
}
.mode-card .mode-best {
	margin-top: auto;
	padding-top: 0.5rem;
	font-size: 0.82rem;
	color: var(--gold);
}
.mode-card .mode-best.empty { color: var(--text-dim); }

.mode-long {
	color: var(--text-muted);
	font-size: 0.95rem;
	margin: 0.5rem 0 1rem;
	max-width: 720px;
}

/* ---------------------------------------------------------------- Quiz: distance grid */
.distance-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 0.65rem;
}
.distance-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	padding: 1rem 0.5rem;
	border-radius: var(--radius);
	border: 1px solid var(--border);
	background: var(--surface-2);
	color: var(--text);
	transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.distance-card:hover {
	border-color: var(--accent-dim);
	background: var(--surface-3);
	transform: translateY(-1px);
}
.distance-card .dist {
	font-family: var(--font-serif);
	font-size: 1.5rem;
	color: var(--text-strong);
	font-variant-numeric: tabular-nums;
}
.distance-card .available {
	font-size: 0.74rem;
	color: var(--text-muted);
}
.distance-card .best {
	font-size: 0.74rem;
	color: var(--gold);
	margin-top: 0.15rem;
}
.distance-card .best.empty { color: var(--text-dim); }

/* ---------------------------------------------------------------- Mixed start */
.mixed-card {
	text-align: center;
	padding: 1.5rem 1rem;
}
.mixed-card .start-btn {
	margin: 0.5rem auto 0;
}

/* ---------------------------------------------------------------- Quiz playing */
.quiz-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem;
	font-size: 0.85rem;
	color: var(--text-muted);
	margin-bottom: 0.65rem;
}
.quiz-meta .dot {
	width: 4px; height: 4px;
	background: var(--text-dim);
	border-radius: 50%;
}
.quiz-meta .mode-name {
	letter-spacing: 0.18em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--accent);
	font-size: 0.78rem;
}

.progress {
	height: 4px;
	border-radius: 2px;
	background: var(--surface-3);
	overflow: hidden;
	margin: 0.4rem 0;
}
.progress-bar {
	height: 100%;
	width: 0%;
	background: var(--accent);
	transition: width 0.35s ease;
}

.scoreline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.25rem;
	font-size: 0.95rem;
	color: var(--text-muted);
}
.scoreline .ok strong   { color: var(--success); font-variant-numeric: tabular-nums; }
.scoreline .ko strong   { color: var(--danger);  font-variant-numeric: tabular-nums; }

/* Quiz header row: "Question X / Y" on the left, score + streak on the right. */
.quiz-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1.25rem;
	margin-bottom: 0.35rem;
}
.quiz-head-counter {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--text-muted);
	font-variant-numeric: tabular-nums;
}
.streak-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.12rem 0.6rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface-2);
	font-variant-numeric: tabular-nums;
	transition: border-color 0.2s ease, background 0.2s ease;
}
.streak-chip strong { color: var(--text-muted); }
.streak-chip.hot {
	border-color: rgba(184, 145, 62, 0.45);
	background: var(--gold-glow);
}
.streak-chip.hot strong { color: var(--gold-hi); }

/* Answer reveal = centered overlay modal (owner request 2026-06-12): the
   verdict floats above the play screen instead of pushing the layout around
   between the sound and the answer grid. Both the solo (#reveal_panel) and
   online (#oq_reveal) reveals share these classes. */
.reveal-panel {
	position: fixed;
	inset: 0;
	z-index: 500;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	margin: 0;
	background: rgba(6, 9, 11, 0.62);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	animation: reveal-backdrop-in 0.18s ease;
}
.reveal-panel:empty { display: none; }
@keyframes reveal-backdrop-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}
.reveal-card {
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 1.1rem 1.4rem;
	background: var(--surface);
	animation: reveal-in 0.25s ease;
	width: 100%;
	max-width: 460px;
	max-height: 85vh;
	overflow-y: auto;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
@keyframes reveal-in {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: none; }
}
.reveal-card.ok {
	border-color: rgba(53, 184, 123, 0.5);
	background: linear-gradient(180deg, var(--success-dim), var(--surface));
}
.reveal-card.ko {
	border-color: rgba(176, 74, 68, 0.5);
	background: linear-gradient(180deg, var(--danger-dim), var(--surface));
}
.reveal-head {
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-size: 0.82rem;
	margin-bottom: 0.5rem;
}
.reveal-card.ok .reveal-head { color: var(--success); }
.reveal-card.ko .reveal-head { color: var(--danger); }
.reveal-picked {
	font-size: 0.9rem;
	color: var(--text-muted);
	margin-bottom: 0.5rem;
}
.reveal-picked s { opacity: 0.8; }
.reveal-body {
	display: flex;
	align-items: center;
	gap: 1rem;
}
.reveal-card-img {
	width: 130px;
	max-height: 56px;
	object-fit: contain;
	flex: 0 0 auto;
	filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}
.reveal-text {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35rem 0.9rem;
}
.reveal-name { font-size: 1.1rem; color: var(--text-strong); }
.reveal-was  { font-size: 0.9rem; color: var(--text-muted); }
.reveal-dist { font-size: 0.9rem; color: var(--text-muted); }
.reveal-dist strong { color: var(--accent-hi); font-variant-numeric: tabular-nums; }
.reveal-streak { font-size: 0.9rem; color: var(--gold-hi); font-weight: 600; }
.reveal-actions { margin-top: 0.85rem; }

.lives {
	display: inline-flex;
	gap: 0.25rem;
	margin-left: auto;
}
.lives .life {
	width: 14px; height: 14px;
	border-radius: 50%;
	background: var(--surface-3);
	border: 1px solid var(--border);
	transition: background 0.2s ease, transform 0.2s ease;
}
.lives .life.on {
	background: var(--danger);
	border-color: var(--danger);
	box-shadow: 0 0 8px rgba(196, 115, 99, 0.4);
}
.lives .life.lost { transform: scale(0.85); opacity: 0.5; }

/* The play stage — center of attention. Compact by default: only takes the
   space its content needs. The reveal-image stays collapsed until shown. */
.play-stage {
	text-align: center;
	padding: 1rem 0 0.85rem;
	margin: 1rem 0 1.25rem;
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
}
.play-stage .hint {
	color: var(--text-muted);
	font-size: 0.9rem;
	margin-bottom: 0.85rem;
}
.play-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.75rem;
}
.play-actions .play-btn { min-width: 200px; }

/* Live audio visualizer — flat decorative bars while idle, animated by the
   AnalyserNode during playback. Intentionally shows nothing identifiable
   before the sound plays. */
.quiz-viz {
	display: block;
	width: min(420px, 90%);
	height: 56px;
	margin: 0 auto 0.85rem;
}
/* No-WebAudio fallback: gentle pulse while the play button is active. */
.quiz-viz.viz-fallback { opacity: 0.4; }
.play-stage:has(.play-btn.playing) .quiz-viz.viz-fallback {
	animation: viz-pulse 0.9s ease-in-out infinite;
}
@keyframes viz-pulse {
	0%, 100% { opacity: 0.35; }
	50%      { opacity: 0.8; }
}

/* Big round play control (mockup): icon circle + label underneath. */
.play-btn-round {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 0.3rem;
	min-width: 0 !important;
	padding: 0.9rem 1.4rem;
	border-radius: var(--radius-lg);
}
.play-btn-round .play-btn-icon {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: rgba(0, 3, 8, 0.25);
	font-size: 1.3rem;
	line-height: 1;
	transition: transform 0.15s ease;
}
.play-btn-round.playing .play-btn-icon { transform: scale(0.94); }
.play-btn-round .play-btn-label { font-weight: 700; }
.play-stage .distance-reveal {
	margin-top: 0.65rem;
	font-size: 0.88rem;
	color: var(--text-muted);
	min-height: 1.4em;
}
.play-stage .distance-reveal .value {
	color: var(--text);
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}
.play-stage .distance-reveal.revealed .value {
	color: var(--accent);
	animation: pulse 0.4s ease;
}
@keyframes pulse {
	0% { transform: scale(1); }
	50% { transform: scale(1.15); }
	100% { transform: scale(1); }
}

.actions {
	display: flex;
	justify-content: center;
	margin: 1rem 0 0.5rem;
}

/* Quiz filter (compact) */
.quiz-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem 1rem;
	align-items: center;
	margin: 1.25rem 0 1rem;
}
.quiz-filter .hint-label {
	font-size: 0.78rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-muted);
	font-weight: 600;
}
.quiz-filter .input { max-width: 240px; }

/* Guess grid — mirrors the home library Cards view: large weapon image on
   top, name + caliber below. Stripped down (no compare button, no distance
   pills) since clicks just answer the quiz. */
.guess-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1rem;
}
.guess {
	display: flex;
	flex-direction: column;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	color: var(--text);
	text-align: left;
	cursor: pointer;
	padding: 0;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.guess:hover {
	border-color: var(--border-hi);
	transform: translateY(-2px);
	box-shadow: var(--shadow-sm);
}
.guess .guess-image {
	position: relative;
	aspect-ratio: 16 / 9;
	background:
		radial-gradient(ellipse at center, var(--surface-3), var(--surface)),
		var(--surface);
	display: flex;
	align-items: center;
	justify-content: center;
	border-bottom: 1px solid var(--border);
}
.guess .guess-thumb {
	max-width: 88%;
	max-height: 88%;
	width: auto;
	height: auto;
	object-fit: contain;
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}
.guess .guess-thumb.placeholder {
	display: inline-block;
	width: 60%;
	height: 70%;
	background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 6px, var(--surface-2) 6px, var(--surface-2) 12px);
	border-radius: var(--radius-sm);
	filter: none;
}
.guess .guess-body {
	padding: 0.7rem 0.9rem 0.85rem;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}
.guess .gname {
	font-family: var(--font-serif);
	font-size: 1.05rem;
	font-weight: 500;
	line-height: 1.2;
	color: var(--text-strong);
}

/* Visual mode — text-only guess cards (no thumbnail to avoid pure image
   matching). Tighter grid, smaller cards. */
.guess-grid.text-only {
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 0.5rem;
}
.guess-grid.text-only .guess { border-radius: var(--radius); }
.guess-grid.text-only .guess .guess-body { padding: 0.75rem 0.95rem; }
.guess.correct {
	border-color: var(--success);
	background: var(--success-dim);
	color: var(--text-strong);
}
.guess.wrong {
	border-color: var(--danger);
	background: var(--danger-dim);
	color: var(--text-strong);
}
.guess.reveal { animation: revealPulse 1.5s ease; }
@keyframes revealPulse {
	0%, 100% { background: var(--surface-2); border-color: var(--border); }
	20%, 80% {
		background: var(--success-dim);
		border-color: var(--success);
		box-shadow: 0 0 0 3px rgba(127, 166, 116, 0.25);
	}
}

/* ---------------------------------------------------------------- Result view */
.result {
	text-align: center;
	padding: 1rem 0;
}
.result .crown {
	color: var(--gold);
	font-size: 1.1rem;
	margin-bottom: 0.5rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
}
.result .score {
	font-family: var(--font-serif);
	font-size: 2rem;
	color: var(--text-strong);
	margin: 0.5rem 0 0.25rem;
}
.result .errors { color: var(--text-muted); margin-bottom: 1.5rem; }
.result .actions { gap: 0.65rem; }

/* ---------------------------------------------------------------- Hunt report (end of quiz) */
.report-head {
	text-align: center;
	margin-bottom: 1.5rem;
}
.report-head .display-sub { display: block; margin-top: 0.4rem; }

.report-grid {
	display: grid;
	grid-template-columns: minmax(240px, 320px) 1fr;
	gap: 1rem;
	margin-bottom: 1rem;
}
.report-grid--bottom {
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
@media (max-width: 640px) {
	.report-grid { grid-template-columns: 1fr; }
}
.report .panel { padding: 1.25rem 1.5rem; }

/* Laurel block — gold wreath around the headline metric. */
.report-laurel {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	min-height: 190px;
}
.report-laurel-svg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	color: var(--gold-dim);
	opacity: 0.9;
	pointer-events: none;
}
.report-laurel-value {
	font-family: var(--font-serif);
	font-size: 3rem;
	line-height: 1;
	color: var(--gold-hi);
	font-variant-numeric: tabular-nums;
}
.report-laurel-sub {
	margin-top: 0.3rem;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--text-muted);
}
.report-record { margin-top: 0.75rem; }

/* Stat rows */
.report-stats { display: flex; flex-direction: column; gap: 0.55rem; }
.report-row {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	color: var(--text);
}
.report-row-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.6em;
	flex: 0 0 auto;
	color: var(--text-muted);
}
.report-row-icon.ok  { color: var(--success); }
.report-row-icon.ko  { color: var(--danger); }
.report-row-icon.hot { color: var(--gold); }
.report-scoreline {
	margin-top: 0.4rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--border);
	color: var(--text-muted);
	font-size: 0.92rem;
}
.report-spark { margin-top: 0.75rem; }
.report-spark-svg {
	display: block;
	width: 100%;
	max-width: 280px;
	height: 40px;
	margin-top: 0.4rem;
	color: var(--accent);
}

/* Frequent error pairs */
.report-errors .panel-title,
.report-distances .panel-title,
.report-xp .panel-title { display: block; margin-bottom: 0.8rem; }
.report-pair {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.45rem 0;
}
.report-pair + .report-pair { border-top: 1px solid var(--border); }
.report-thumb {
	width: 72px;
	max-height: 32px;
	object-fit: contain;
	flex: 0 0 auto;
}
.report-thumb.placeholder { height: 32px; background: var(--surface-3); border-radius: var(--radius-sm); }
.report-pair-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.report-pair-names { color: var(--text-strong); font-size: 0.95rem; }
.report-pair-names em { color: var(--text-dim); font-style: italic; padding: 0 0.15rem; }
.report-pair-count { color: var(--danger); font-size: 0.8rem; }
.report-skips { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.6rem; }
.report-flawless { color: var(--gold-hi); }

/* Distance mastery bars */
.report-dist-row {
	display: grid;
	grid-template-columns: 52px 1fr 44px;
	align-items: center;
	gap: 0.6rem;
	padding: 0.3rem 0;
}
.report-dist-label {
	font-size: 0.85rem;
	color: var(--text-muted);
	font-variant-numeric: tabular-nums;
	text-align: right;
}
.report-dist-pct {
	font-size: 0.85rem;
	color: var(--text);
	font-variant-numeric: tabular-nums;
}

/* XP panel */
.report-xp-gain {
	font-family: var(--font-serif);
	font-size: 2rem;
	color: var(--gold-hi);
	margin-bottom: 0.35rem;
	font-variant-numeric: tabular-nums;
}
.report-xp-levels {
	display: flex;
	gap: 0.6rem;
	align-items: baseline;
	color: var(--text-muted);
	font-size: 0.9rem;
	margin-bottom: 0.4rem;
}
.report-xp-up { color: var(--gold-hi); font-weight: 600; }
.report-xp-numbers {
	margin-top: 0.35rem;
	font-size: 0.8rem;
	color: var(--text-dim);
	font-variant-numeric: tabular-nums;
}
.report-xp-hint { margin-top: 0.6rem; font-size: 0.78rem; color: var(--text-dim); }

/* ---------------------------------------------------------------- Footer */
footer {
	max-width: var(--container-max);
	margin: 3rem auto 0;
	padding: 2rem 1.25rem;
	border-top: 1px solid var(--border);
	color: var(--text-muted);
	font-size: 0.88rem;
	text-align: center;
}
footer p { margin-bottom: 0.5rem; }
footer .heart { color: var(--danger); }
footer .socials {
	display: flex;
	justify-content: center;
	gap: 1.25rem;
	margin-top: 1rem;
}
footer .socials a {
	color: var(--text-dim);
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.85rem;
}
footer .socials a:hover { color: var(--text); }

/* ---------------------------------------------------------------- Loading & errors */
.notice {
	padding: 1rem 1.25rem;
	border-radius: var(--radius);
	background: var(--surface-2);
	border: 1px solid var(--border);
	color: var(--text-muted);
	text-align: center;
}
.notice.error { color: var(--danger); border-color: var(--danger); background: var(--danger-dim); }
.notice.empty { font-style: italic; }

/* ---------------------------------------------------------------- Achievements */
.ach-section {
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
}
.ach-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 1rem;
	gap: 1rem;
	flex-wrap: wrap;
}
.ach-header h2 { margin: 0; }
.ach-progress {
	color: var(--text-muted);
	font-size: 0.85rem;
}

.ach-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 0.6rem;
}

.ach-card {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.65rem;
	align-items: center;
	padding: 0.7rem 0.85rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: transform 0.15s ease, border-color 0.15s ease;
}
.ach-card.unlocked:hover {
	transform: translateY(-2px);
}
.ach-card.locked {
	opacity: 0.55;
	filter: grayscale(0.7);
}
.ach-icon {
	font-size: 1.5rem;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 50%;
	flex-shrink: 0;
}
.ach-body { min-width: 0; }
.ach-tier {
	font-size: 0.62rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	font-weight: 700;
	margin-bottom: 0.15rem;
}
.ach-title {
	font-family: var(--font-serif);
	font-size: 1rem;
	color: var(--text-strong);
	line-height: 1.15;
	margin-bottom: 0.1rem;
}
.ach-desc {
	font-size: 0.78rem;
	color: var(--text-muted);
	line-height: 1.3;
}

/* Tier colors (visible on unlocked cards) */
.ach-card.unlocked.tier-bronze   { border-color: rgba(205, 127, 50, 0.45); }
.ach-card.unlocked.tier-bronze   .ach-tier { color: #cd7f32; }
.ach-card.unlocked.tier-bronze   .ach-icon { background: rgba(205, 127, 50, 0.10); border-color: rgba(205, 127, 50, 0.35); }
.ach-card.unlocked.tier-silver   { border-color: rgba(192, 192, 192, 0.45); }
.ach-card.unlocked.tier-silver   .ach-tier { color: #c0c0c0; }
.ach-card.unlocked.tier-silver   .ach-icon { background: rgba(192, 192, 192, 0.10); border-color: rgba(192, 192, 192, 0.35); }
.ach-card.unlocked.tier-gold     { border-color: rgba(184, 145, 62, 0.55); box-shadow: 0 0 12px rgba(184, 145, 62, 0.12); }
.ach-card.unlocked.tier-gold     .ach-tier { color: var(--gold); }
.ach-card.unlocked.tier-gold     .ach-icon { background: rgba(184, 145, 62, 0.10); border-color: rgba(184, 145, 62, 0.4); }
.ach-card.unlocked.tier-platinum { border-color: rgba(65, 219, 188, 0.55); box-shadow: 0 0 14px rgba(65, 219, 188, 0.15); }
.ach-card.unlocked.tier-platinum .ach-tier { color: var(--accent); }
.ach-card.unlocked.tier-platinum .ach-icon { background: rgba(65, 219, 188, 0.10); border-color: rgba(65, 219, 188, 0.4); }
.ach-card.locked .ach-tier { color: var(--text-dim); }

/* Achievement toast (slides in top-right) */
#achievementToasts {
	position: fixed;
	top: calc(var(--topbar-h) + 0.75rem);
	right: 1rem;
	z-index: 300;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	pointer-events: none;
}
.ach-toast {
	pointer-events: auto;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.75rem;
	align-items: center;
	padding: 0.75rem 1rem;
	background: var(--surface-2);
	border: 1px solid var(--border-hi);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	min-width: 280px;
	max-width: 360px;
	animation: achSlideIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ach-toast.exit {
	animation: achSlideOut 0.6s cubic-bezier(0.4, 0, 1, 1) forwards;
}
.ach-toast-icon {
	font-size: 1.75rem;
	width: 48px; height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--surface);
	border-radius: 50%;
	flex-shrink: 0;
}
.ach-toast-eyebrow {
	font-size: 0.62rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	font-weight: 700;
	color: var(--text-muted);
	margin-bottom: 0.15rem;
}
.ach-toast-title {
	font-family: var(--font-serif);
	font-size: 1.1rem;
	color: var(--text-strong);
	margin-bottom: 0.1rem;
}
.ach-toast-desc {
	font-size: 0.78rem;
	color: var(--text-muted);
}
.ach-toast.tier-bronze   { border-color: rgba(205, 127, 50, 0.55); }
.ach-toast.tier-bronze   .ach-toast-eyebrow { color: #cd7f32; }
.ach-toast.tier-silver   { border-color: rgba(192, 192, 192, 0.55); }
.ach-toast.tier-silver   .ach-toast-eyebrow { color: #c0c0c0; }
.ach-toast.tier-gold     { border-color: rgba(184, 145, 62, 0.65); box-shadow: 0 8px 28px rgba(184, 145, 62, 0.18); }
.ach-toast.tier-gold     .ach-toast-eyebrow { color: var(--gold); }
.ach-toast.tier-platinum { border-color: rgba(65, 219, 188, 0.65); box-shadow: 0 8px 28px rgba(65, 219, 188, 0.22); }
.ach-toast.tier-platinum .ach-toast-eyebrow { color: var(--accent); }
@keyframes achSlideIn {
	from { opacity: 0; transform: translateX(120%); }
	to   { opacity: 1; transform: translateX(0); }
}
@keyframes achSlideOut {
	from { opacity: 1; transform: translateX(0); }
	to   { opacity: 0; transform: translateX(120%); }
}
@media (max-width: 600px) {
	#achievementToasts { left: 1rem; right: 1rem; }
	.ach-toast { min-width: 0; max-width: none; }
}

/* ---------------------------------------------------------------- View transitions */
.view {
	animation: viewIn 0.25s ease;
}
@keyframes viewIn {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------- Settings panel */
.settings-panel {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 200;
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding-top: calc(var(--topbar-h) + 1rem);
}
.settings-panel.open { display: flex; }
.settings-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
	width: 100%;
	max-width: 460px;
	margin: 0 1rem;
	padding: 1.25rem 1.5rem 1.5rem;
}
.settings-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1rem;
}
.settings-head h2 { font-size: 1.4rem; margin: 0; }
.settings-close {
	width: 28px; height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.4rem;
	color: var(--text-muted);
	border-radius: var(--radius);
}
.settings-close:hover { background: var(--surface-2); color: var(--text); }
.settings-section {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--border);
}
.settings-section:first-of-type {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
}
.settings-label {
	display: block;
	font-size: 0.85rem;
	color: var(--text);
	margin-bottom: 0.5rem;
	font-weight: 600;
}
.settings-help {
	font-size: 0.8rem;
	color: var(--text-muted);
	margin-top: 0.4rem;
}
.settings-section input[type="range"] {
	width: 100%;
	accent-color: var(--accent);
}
.btn-ghost.danger { color: var(--danger); border-color: rgba(220, 53, 69, 0.4); }
.btn-ghost.danger:hover { background: rgba(220, 53, 69, 0.1); border-color: var(--danger); }

/* ---------------------------------------------------------------- Stats view */
/* Tabs at the top of the Stats view */
.stats-tabs {
	display: flex;
	gap: 0.25rem;
	border-bottom: 1px solid var(--border);
	margin: 0.5rem 0 1.5rem;
}
.stats-tab {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.6rem 1rem;
	background: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	color: var(--text-muted);
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
	margin-bottom: -1px;  /* overlap the bottom border to align */
}
.stats-tab:hover {
	color: var(--text);
}
.stats-tab.active {
	color: var(--accent);
	border-bottom-color: var(--accent);
}
.stats-tab-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.1rem 0.45rem;
	border-radius: 999px;
	background: var(--surface-2);
	font-size: 0.72rem;
	color: var(--text-muted);
	letter-spacing: 0.04em;
	font-variant-numeric: tabular-nums;
}
.stats-tab.active .stats-tab-badge {
	background: var(--accent-glow);
	color: var(--accent);
}

.ach-section.as-tab { margin-top: 0; padding-top: 0; border-top: none; }

.stats-actions {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	margin-bottom: 1.5rem;
}
.stats-actions .text-muted { display: inline-flex; align-items: center; font-style: italic; }

.stats-wrap {
	overflow-x: auto;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
}
.stats-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92rem;
}
.stats-table th,
.stats-table td {
	padding: 0.6rem 0.85rem;
	text-align: left;
	border-bottom: 1px solid var(--border);
}
.stats-table th {
	font-size: 0.72rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--text-muted);
	font-weight: 600;
	background: var(--surface-2);
	position: sticky;
	top: 0;
}
.stats-table tr:last-child td { border-bottom: none; }
.stats-table tr:hover td { background: var(--surface-2); }
.stats-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.stats-table .rate {
	display: inline-block;
	padding: 0.1rem 0.5rem;
	border-radius: 999px;
	font-weight: 700;
	font-size: 0.82rem;
}
.stats-table .rate-good { color: var(--success); background: rgba(25, 135, 84, 0.12); }
.stats-table .rate-mid  { color: var(--gold);    background: rgba(184, 145, 62, 0.12); }
.stats-table .rate-bad  { color: var(--danger);  background: rgba(220, 53, 69, 0.12); }
.stats-table .conf-count {
	color: var(--text-muted);
	font-variant-numeric: tabular-nums;
	font-size: 0.85rem;
}

/* ---------------------------------------------------------------- Weapon thumbnails & details */
.weapon-thumb {
	width: 56px;
	height: 56px;
	object-fit: contain;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	flex-shrink: 0;
	padding: 0.15rem;
}
.weapon-thumb.placeholder {
	display: inline-block;
	background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 6px, var(--surface-2) 6px, var(--surface-2) 12px);
}
.weapon-card .weapon-thumb.size-card.placeholder {
	width: 60%;
	height: 70%;
	min-width: 80px;
	min-height: 60px;
}

.weapon-row-main {
	display: flex;
	align-items: center;
	gap: 0.85rem;
}
.weapon-row-label {
	flex: 1 1 auto;
	min-width: 0;
}
.weapon-detail-btn {
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-sm);
	color: var(--text-muted);
	transition: color 0.15s ease, background 0.15s ease;
	flex-shrink: 0;
}
.weapon-detail-btn:hover { color: var(--accent); background: var(--surface-3); }
.weapon-detail-btn svg { width: 18px; height: 18px; }

@media (max-width: 600px) {
	.weapon-thumb { width: 44px; height: 44px; }
}

/* ============================================== Weapon detail modal (redesigned) */
.weapon-detail-card {
	max-width: 640px;
	padding: 0;       /* hero spans edge-to-edge */
	overflow: hidden;
	position: relative;
}
.detail-close-floating {
	position: absolute;
	top: 0.65rem;
	right: 0.65rem;
	z-index: 2;
	background: rgba(0, 3, 8, 0.55);
	backdrop-filter: blur(4px);
	border-radius: 50%;
	width: 32px; height: 32px;
	color: var(--text);
}
.detail-close-floating:hover { background: rgba(0, 3, 8, 0.85); color: var(--text-strong); }

/* Hero band with image + name */
.detail-hero {
	position: relative;
	padding: 1.25rem 1.5rem 1rem;
	background:
		radial-gradient(ellipse 60% 80% at 70% 30%, rgba(65, 219, 188, 0.10), transparent 70%),
		linear-gradient(180deg, var(--surface-3) 0%, var(--surface) 100%);
	border-bottom: 1px solid var(--border);
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
	gap: 1rem;
	align-items: center;
}
.detail-hero.placeholder { grid-template-columns: 1fr; padding: 2rem; text-align: center; }
.detail-hero-image {
	width: 100%;
	max-height: 160px;
	object-fit: contain;
	filter: drop-shadow(0 4px 14px rgba(0,0,0,0.55));
}
.detail-hero-info { min-width: 0; }
.detail-name {
	font-family: var(--font-serif);
	font-size: 1.85rem;
	color: var(--text-strong);
	margin: 0 0 0.5rem;
	line-height: 1.1;
}
.detail-meta-strip {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: center;
}
.detail-meta-strip .meta-chip {
	padding: 0.18rem 0.55rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: 0.78rem;
	color: var(--text-muted);
}
.detail-meta-strip .meta-chip.price {
	color: var(--gold);
	border-color: rgba(184, 145, 62, 0.4);
}

/* Distance buttons section in modal */
.detail-distances {
	padding: 1rem 1.5rem 0.5rem;
	border-bottom: 1px solid var(--border);
}
.detail-distances h3 {
	font-size: 0.72rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--text-muted);
	font-weight: 600;
	margin-bottom: 0.5rem;
	font-family: var(--font-sans);
}
.detail-distances .distances {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
}

/* Grouped stat bars */
.stat-groups {
	padding: 1rem 1.5rem 1.25rem;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem 1.5rem;
}
.stat-group h3 {
	font-size: 0.72rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--accent);
	font-weight: 700;
	margin-bottom: 0.5rem;
	font-family: var(--font-sans);
	padding-bottom: 0.3rem;
	border-bottom: 1px solid var(--border);
}
.stat-line {
	display: grid;
	grid-template-columns: 6rem 1fr auto;
	gap: 0.6rem;
	align-items: center;
	margin-bottom: 0.35rem;
	font-size: 0.85rem;
}
.stat-line .stat-name {
	color: var(--text-muted);
	font-size: 0.78rem;
	letter-spacing: 0.04em;
}
.stat-line .stat-value {
	font-variant-numeric: tabular-nums;
	color: var(--text);
	font-weight: 600;
	min-width: 2.5rem;
	text-align: right;
}
.stat-line .stat-track {
	height: 6px;
	background: var(--surface);
	border-radius: 3px;
	overflow: hidden;
	position: relative;
}
.stat-line .stat-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--accent-dim), var(--accent));
	border-radius: 3px;
	transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.stat-line .stat-fill.inverted {
	background: linear-gradient(90deg, rgba(127, 166, 116, 0.6), var(--success));
}

@media (max-width: 600px) {
	.detail-hero { grid-template-columns: 1fr; text-align: center; }
	.detail-hero-image { max-height: 120px; }
	.detail-name { font-size: 1.5rem; }
	.stat-groups { grid-template-columns: 1fr; padding: 1rem; }
	.stat-line { grid-template-columns: 5rem 1fr auto; }
}

/* Quiz reveal image — collapsed until the answer is revealed so it doesn't
   reserve empty space at the top of the play stage. */
.reveal-image {
	display: none;
}
.reveal-image.shown {
	display: block;
	max-width: 220px;
	max-height: 120px;
	margin: 0 auto 0.75rem;
	object-fit: contain;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 0.4rem;
	animation: revealImageIn 0.35s ease;
}
@keyframes revealImageIn {
	from { opacity: 0; transform: scale(0.92); }
	to   { opacity: 1; transform: scale(1); }
}

/* Stats table thumbnails */
.stats-name {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}
.stats-thumb {
	width: 36px;
	height: 36px;
	object-fit: contain;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	flex-shrink: 0;
	padding: 0.15rem;
}
.stats-thumb.placeholder {
	display: inline-block;
	background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 6px, var(--surface-2) 6px, var(--surface-2) 12px);
}

/* ---------------------------------------------------------------- Daily Challenge */
.daily-date {
	color: var(--text-muted);
	font-size: 0.85rem;
	letter-spacing: 0.05em;
	margin-bottom: 0.75rem;
}
.daily-grid {
	font-size: 1.6rem;
	letter-spacing: 0.15em;
	margin: 0.5rem 0;
	font-family: var(--font-mono);
}
.daily-share.flash {
	background: var(--success);
	border-color: var(--success);
	color: #fff;
}

/* ---------------------------------------------------------------- Utility */
.sr-only {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0,0,0,0);
	white-space: nowrap;
	border: 0;
}
.hidden { display: none !important; }

/* =============================================================================
   Auth widget — dev-only login/register UI (matches Hunt theme).
   Injected by the dev-gated tail of custom-scripts.js. Lives in the topbar
   next to .settings-toggle / .lang-switcher.
   ============================================================================= */
.auth-widget { position: relative; display: flex; align-items: center; }

.auth-login-btn,
.auth-user-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	height: 32px;
	padding: 0 0.65rem;
	border-radius: 6px;
	background: transparent;
	color: var(--text);
	border: 1px solid var(--border);
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.auth-login-btn:hover,
.auth-login-btn:focus-visible,
.auth-user-btn:hover,
.auth-user-btn:focus-visible {
	background: var(--surface-2);
	color: var(--accent-hi);
	border-color: var(--border-hi);
}
.auth-login-btn svg,
.auth-user-btn svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}
.auth-user-label {
	max-width: 12ch;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.auth-user-menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	min-width: 220px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
	padding: 0.35rem 0;
	display: none;
	z-index: 1000;
}
.auth-user-menu.open { display: block; }

.auth-user-menu-head {
	padding: 0.5rem 0.75rem 0.6rem;
	border-bottom: 1px solid var(--border);
	margin-bottom: 0.25rem;
}
.auth-user-menu-name   { color: var(--text-strong); font-weight: 600; font-size: 0.9rem; }
.auth-user-menu-handle { color: var(--text-muted);  font-size: 0.78rem; margin-top: 0.1rem; }

.auth-menu-item {
	display: block;
	width: 100%;
	text-align: left;
	background: transparent;
	color: var(--text);
	border: 0;
	padding: 0.5rem 0.75rem;
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
}
.auth-menu-item:hover,
.auth-menu-item:focus-visible { background: var(--surface-2); color: var(--accent-hi); }
.auth-menu-danger:hover,
.auth-menu-danger:focus-visible { color: var(--danger); background: var(--danger-dim); }

/* ----- Modal ---------------------------------------------------------- */
.auth-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 2000;
	padding: 1rem;
}
.auth-modal-backdrop.open { display: flex; }

.auth-modal {
	width: 100%;
	max-width: 420px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
	color: var(--text);
	padding: 1.25rem 1.25rem 1rem;
}

.auth-modal-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 0.75rem;
}
.auth-modal-title {
	margin: 0;
	font-size: 1.15rem;
	color: var(--text-strong);
	font-family: inherit;
}
.auth-modal-close {
	background: transparent;
	border: 0;
	color: var(--text-muted);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	padding: 0 0.25rem;
}
.auth-modal-close:hover { color: var(--text-strong); }

.auth-tabs {
	display: flex;
	gap: 0.25rem;
	border-bottom: 1px solid var(--border);
	margin-bottom: 0.85rem;
}
.auth-tab {
	background: transparent;
	color: var(--text-muted);
	border: 0;
	padding: 0.5rem 0.85rem;
	cursor: pointer;
	font: inherit;
	font-size: 0.88rem;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	transition: color 0.15s ease, border-color 0.15s ease;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active {
	color: var(--accent-hi);
	border-bottom-color: var(--accent);
}

.auth-error {
	min-height: 1.2em;
	color: var(--danger);
	font-size: 0.82rem;
	margin-bottom: 0.5rem;
}
.auth-error:empty { min-height: 0; margin-bottom: 0; }

.auth-field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.7rem; }
.auth-label {
	color: var(--text-muted);
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.auth-input {
	background: var(--surface-2);
	color: var(--text-strong);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 0.55rem 0.7rem;
	font: inherit;
	font-size: 0.95rem;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.auth-input:focus {
	outline: none;
	border-color: var(--accent);
	background: var(--surface-3);
}

.auth-form-actions { display: flex; justify-content: flex-end; margin-top: 0.4rem; }
.auth-submit {
	background: var(--accent);
	color: var(--bg);
	border: 0;
	border-radius: 6px;
	padding: 0.55rem 1.1rem;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}
.auth-submit:hover:not(:disabled) { background: var(--accent-hi); }
.auth-submit:disabled { background: var(--accent-dim); cursor: progress; }

/* Honeypot field — visually & a11y-hidden but still in the form. Real users
   never see it; blind bots gleefully fill it and get rejected server-side. */
.auth-honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.auth-explain {
	color: var(--text);
	font-size: 0.9rem;
	line-height: 1.4;
	margin: 0 0 0.85rem;
}
.auth-explain.auth-error { color: var(--danger); }

.auth-secondary-row {
	display: flex;
	justify-content: flex-end;
	margin-top: 0.4rem;
}
.auth-tiny-link {
	background: transparent;
	border: 0;
	color: var(--text-muted);
	font: inherit;
	font-size: 0.78rem;
	cursor: pointer;
	text-decoration: underline dotted;
	text-underline-offset: 3px;
	padding: 0.15rem 0;
}
.auth-tiny-link:hover,
.auth-tiny-link:focus-visible { color: var(--accent-hi); }

/* ----- Account settings panel ----------------------------------------- */
.auth-section-title {
	margin: 1.4rem 0 0.5rem;
	padding-top: 0.9rem;
	border-top: 1px solid var(--border);
	color: var(--text-strong);
	font-size: 0.95rem;
	font-weight: 600;
}
.auth-section-danger { color: var(--danger); }
.auth-hint {
	color: var(--text-muted);
	font-size: 0.8rem;
	line-height: 1.4;
	margin: 0 0 0.6rem;
}
.auth-success {
	min-height: 1.2em;
	color: var(--success);
	font-size: 0.82rem;
	margin-top: 0.4rem;
}
.auth-success:empty { min-height: 0; margin-top: 0; }
.auth-submit-danger { background: var(--danger); color: #fff; }
.auth-submit-danger:hover:not(:disabled) { background: var(--danger); filter: brightness(1.15); }

/* =============================================================================
   Online quiz wizard — rendered DIRECTLY into #app .picker-stub (no extra
   wrapper). The page-level padding/max-width comes from `.page` on #app,
   exactly like #Daily / #Stats. No `.oq-wizard` / `.oq-panel` containers.
   ============================================================================= */

/* .oq-panel and .oq-close are gone — the wizard renders direct children of
   .picker-stub (no wrapper). Back navigation uses .oq-back-link styled by
   .btn .btn-ghost .link. */

/* .oq-title is now <h1>, inherits the global h1 styles (Cormorant
   Garamond serif, clamp 1.85-2.6rem). No size override here.
   Same for .oq-explain → replaced by .intro in the JS. */
.oq-loading {
	color: var(--text-muted);
	font-style: italic;
	text-align: center;
	margin: 1.5rem 0;
}
.oq-error {
	color: var(--danger);
	font-size: 0.88rem;
	margin: 0.4rem 0;
}

/* Menu */
.oq-menu { display: flex; flex-direction: column; gap: 0.5rem; }
.oq-menu-item {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.2rem;
	padding: 0.7rem 0.9rem;
	background: var(--surface-2);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 8px;
	font: inherit;
	cursor: pointer;
	text-align: left;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.oq-menu-item strong { color: var(--text-strong); font-size: 0.95rem; }
.oq-menu-item span   { color: var(--text-muted);  font-size: 0.78rem; }
.oq-menu-item:hover,
.oq-menu-item:focus-visible {
	background: var(--surface-3);
	border-color: var(--border-hi);
}

/* Forms */
.oq-form { display: flex; flex-direction: column; gap: 0.65rem; }
.oq-field { display: flex; flex-direction: column; gap: 0.3rem; }
.oq-label {
	color: var(--text-muted);
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.oq-input {
	background: var(--surface-2);
	color: var(--text-strong);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 0.5rem 0.65rem;
	font: inherit;
	font-size: 0.95rem;
}
.oq-input:focus { outline: none; border-color: var(--accent); }

.oq-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-top: 0.5rem;
}
.oq-btn-primary {
	background: var(--accent);
	color: var(--bg);
	border: 0;
	border-radius: 6px;
	padding: 0.5rem 1rem;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.oq-btn-primary:hover:not(:disabled) { background: var(--accent-hi); }
.oq-btn-primary:disabled { background: var(--accent-dim); cursor: progress; }
.oq-btn-ghost {
	background: transparent;
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 0.5rem 1rem;
	font: inherit;
	cursor: pointer;
}
.oq-btn-ghost:hover { background: var(--surface-2); border-color: var(--border-hi); color: var(--accent-hi); }

/* Share URL */
.oq-url-box {
	display: flex;
	gap: 0.4rem;
	align-items: center;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 0.5rem;
	margin: 0.5rem 0;
}
.oq-url {
	flex: 1;
	color: var(--accent-hi);
	font-family: monospace;
	font-size: 0.78rem;
	word-break: break-all;
	user-select: all;
}

/* Play screen */
.oq-progress {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.85rem;
	color: var(--text-muted);
	font-size: 0.85rem;
}
.oq-mode-pill {
	background: var(--accent-glow);
	color: var(--accent-hi);
	padding: 0.15rem 0.55rem;
	border-radius: 999px;
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.oq-audio { width: 100%; margin: 0.5rem 0; }
.oq-audio-hidden { display: none; }     /* keep the <audio> element off-screen */
.oq-replay-row { justify-content: center; margin-top: 0.25rem; margin-bottom: 0.75rem; }

/* Custom Play / Replay control — replaces the native <audio controls>.
   No native scrubber → harder to skip to the end of the gunshot. */
.oq-play-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.65rem;
	width: 100%;
	background: var(--surface-2);
	color: var(--text-strong);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 1rem 1.25rem;
	margin: 0.75rem 0 0.5rem;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.oq-play-btn:hover,
.oq-play-btn:focus-visible {
	background: var(--surface-3);
	border-color: var(--accent);
	color: var(--accent-hi);
}
.oq-play-btn:active { transform: scale(0.98); }
.oq-play-icon {
	font-size: 1.4rem;
	line-height: 1;
	color: var(--accent);
}

/* Answer feedback (700ms reveal between question and next). */
.oq-feedback {
	text-align: center;
	font-size: 0.95rem;
	font-weight: 600;
	padding: 0.55rem 0.75rem;
	border-radius: 8px;
	margin: 0.4rem 0;
	animation: oq-feedback-in 150ms ease-out;
}
.oq-feedback-ok {
	background: rgba(65, 219, 188, 0.18);
	color: var(--accent-hi);
	border: 1px solid var(--accent-dim);
}
.oq-feedback-ko {
	background: var(--danger-dim);
	color: var(--danger);
	border: 1px solid var(--danger);
}
@keyframes oq-feedback-in {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: none; }
}

.oq-choice[disabled] { cursor: default; }
.oq-choice-correct {
	background: rgba(65, 219, 188, 0.20) !important;
	border-color: var(--accent) !important;
	color: var(--accent-hi) !important;
}
.oq-choice-wrong {
	background: var(--danger-dim) !important;
	border-color: var(--danger) !important;
	color: var(--danger) !important;
}

/* Title is briefly focusable to anchor screen readers — hide the
   outline ring that browsers draw on programmatic focus. */
.oq-title:focus { outline: none; }
.oq-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.oq-visual {
	display: flex;
	justify-content: center;
	margin: 0.5rem 0 0.85rem;
}
.oq-visual-img {
	max-width: 100%;
	max-height: 180px;
	border-radius: 6px;
	border: 1px solid var(--border);
	background: var(--surface-2);
}

.oq-choices {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
	margin-top: 0.5rem;
}
.oq-choice {
	background: var(--surface-2);
	color: var(--text-strong);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 0.85rem 0.6rem;
	font: inherit;
	font-size: 0.92rem;
	cursor: pointer;
	transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
	/* Apple HIG / Google M3 recommend ≥ 44-48 px tap targets. */
	min-height: 48px;
}
@media (max-width: 420px) {
	/* Single column avoids weapon-name truncation on small phones. */
	.oq-choices { grid-template-columns: 1fr; }
}
.oq-choice:hover,
.oq-choice:focus-visible {
	background: var(--surface-3);
	border-color: var(--accent);
	color: var(--accent-hi);
}

/* End-of-run + leaderboard */
.oq-summary {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	align-items: center;
	margin: 0.85rem 0;
}
.oq-score-num {
	font-size: 2rem;
	font-weight: 700;
	color: var(--accent);
}
.oq-time {
	color: var(--text-muted);
	font-size: 0.88rem;
}
.oq-flagged {
	color: var(--danger);
	font-size: 0.82rem;
	margin-top: 0.25rem;
}
.oq-kept-best {
	color: var(--text-muted);
	font-size: 0.82rem;
	margin-top: 0.25rem;
}

/* Time Attack countdown pill (between the question counter and mode pill) */
.oq-ta-timer {
	font-variant-numeric: tabular-nums;
	color: var(--text-strong);
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 0.15rem 0.6rem;
	font-size: 0.8rem;
}
.oq-ta-timer.oq-ta-low { color: var(--danger); border-color: var(--danger); }

/* "See today's leaderboard" entry link under the online mode grid */
.oq-lb-entry {
	display: flex;
	justify-content: center;
	margin-top: 1.25rem;
}

/* Daily/Speedrun toggle on the view-only leaderboard screen */
.oq-lb-toggle {
	display: flex;
	gap: 0.5rem;
	justify-content: center;
	margin: 0.5rem 0 1.25rem;
}
.oq-lb-toggle-btn {
	background: var(--surface-2);
	color: var(--text-muted);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 0.35rem 1rem;
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.oq-lb-toggle-btn:hover { color: var(--text-strong); }
.oq-lb-toggle-btn.active {
	background: var(--accent-glow);
	color: var(--accent-hi);
	border-color: var(--accent);
}
.oq-lb-slot { min-height: 4rem; }

.oq-lb { margin: 0.5rem 0; }
.oq-lb-title {
	color: var(--text-muted);
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 0.35rem;
}
.oq-lb-empty {
	color: var(--text-dim);
	font-style: italic;
	font-size: 0.85rem;
}
.oq-lb-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.88rem;
}
.oq-lb-table th, .oq-lb-table td {
	padding: 0.4rem 0.5rem;
	border-bottom: 1px solid var(--border);
	text-align: left;
}
.oq-lb-table th {
	color: var(--text-muted);
	font-weight: 600;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.oq-lb-table td:first-child { width: 2.5rem; color: var(--text-muted); }
.oq-lb-table td:nth-child(3),
.oq-lb-table td:nth-child(4) { width: 5rem; }

/* --- Wizard --------------------------------------------------------------- */
.oq-wizard-head {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	margin-bottom: 1rem;
}
.oq-step {
	color: var(--text-muted);
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.oq-back {
	align-self: flex-start;
	background: transparent;
	border: 0;
	color: var(--text-muted);
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
	padding: 0.25rem 0;
	margin-bottom: 0.25rem;
}
.oq-back:hover { color: var(--accent-hi); }
.oq-wizard-head .oq-title {
	font-family: 'Cormorant Garamond', serif;
	font-size: 1.7rem;
	font-weight: 500;
	color: var(--text-strong);
	margin: 0;
	line-height: 1.1;
}

/* Step 1: branch cards */
.oq-branch-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}
.oq-branch {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	text-align: left;
	background: var(--surface-2);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 1.25rem;
	font: inherit;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.oq-branch:hover,
.oq-branch:focus-visible {
	background: var(--surface-3);
	border-color: var(--accent);
	transform: translateY(-1px);
}
.oq-branch-icon { font-size: 2rem; line-height: 1; }
.oq-branch-title {
	font-family: 'Cormorant Garamond', serif;
	font-size: 1.6rem;
	font-weight: 500;
	color: var(--text-strong);
	line-height: 1;
}
.oq-branch-tag {
	color: var(--accent-hi);
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.oq-branch-desc {
	color: var(--text-muted);
	font-size: 0.88rem;
	line-height: 1.45;
}
.oq-branch-feat {
	list-style: none;
	margin: 0.25rem 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}
.oq-branch-feat li {
	color: var(--text);
	font-size: 0.82rem;
	padding-left: 1.1rem;
	position: relative;
}
.oq-branch-feat li::before {
	content: '✓';
	position: absolute;
	left: 0;
	color: var(--accent);
	font-weight: 700;
}
.oq-branch-go {
	margin-top: 0.4rem;
	color: var(--accent-hi);
	font-size: 0.9rem;
	font-weight: 600;
}

/* Step 2: mode grid */
.oq-mode-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 0.65rem;
}
.oq-mode-card {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	text-align: left;
	background: var(--surface-2);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 0.85rem 0.9rem 0.9rem;
	font: inherit;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
	position: relative;
}
.oq-mode-card:hover,
.oq-mode-card:focus-visible {
	background: var(--surface-3);
	border-color: var(--accent);
	transform: translateY(-1px);
}
.oq-mode-featured {
	border-color: var(--accent-dim);
	box-shadow: 0 0 0 1px var(--accent-glow) inset;
}
.oq-mode-badge {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	background: var(--accent);
	color: var(--bg);
	font-size: 0.65rem;
	letter-spacing: 0.05em;
	padding: 0.1rem 0.45rem;
	border-radius: 999px;
	text-transform: uppercase;
	font-weight: 700;
}
.oq-mode-icon { font-size: 1.4rem; line-height: 1; color: var(--accent-hi); }
.oq-mode-name {
	color: var(--text-strong);
	font-weight: 600;
	font-size: 0.98rem;
}
.oq-mode-desc {
	color: var(--text-muted);
	font-size: 0.78rem;
	line-height: 1.35;
	min-height: 2.5em;
}
.oq-mode-go {
	color: var(--accent-hi);
	font-size: 0.78rem;
	font-weight: 600;
	margin-top: 0.2rem;
}

/* ---- Merged picker ("Pick your contract") ---- */
.oq-picker-head {
	text-align: center;
	margin-bottom: 1.25rem;
}
.oq-picker-head .display-sub { display: block; margin-top: 0.4rem; }
.oq-picker-seg-row {
	display: flex;
	justify-content: center;
	margin-bottom: 1.5rem;
}
.oq-picker-grid { margin-top: 0.5rem; }
.oq-picker-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.4rem;
	padding: 1.4rem 1rem 1.2rem;
}
.oq-mode-ico {
	font-family: var(--font-serif);
	font-size: 1.8rem;
	line-height: 1;
	color: var(--gold);
	filter: drop-shadow(0 2px 6px rgba(184, 145, 62, 0.25));
}
.oq-mode-streak { margin-top: 0.3rem; }

/* ---- Mission config ("Configure your mission") ---- */
.oq-config-title { margin-bottom: 1rem; }
.oq-config-mode {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.25rem;
	background: var(--surface);
	border: 1px solid var(--border-hi);
	border-radius: var(--radius-lg);
	margin-bottom: 1.5rem;
}
.oq-config-mode .mode-name { font-size: 1.05rem; }
.oq-config-sec {
	display: block;
	margin: 1.4rem 0 0.6rem;
}
.oq-config-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.oq-config-pool {
	margin-top: 1.25rem;
	color: var(--text-muted);
	font-size: 0.9rem;
	font-variant-numeric: tabular-nums;
}
.oq-config-actions { margin-top: 0.75rem; }
.oq-config-start { min-width: 240px; }
.oq-config-shortcuts {
	margin-top: 1rem;
	color: var(--text-dim);
	font-size: 0.8rem;
}
.oq-mode-need {
	color: var(--text-dim);
	font-size: 0.72rem;
	font-style: italic;
	margin-top: 0.2rem;
}

/* Step 3: distance grid */
.oq-dist-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
	gap: 0.55rem;
}
.oq-dist-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.15rem;
	background: var(--surface-2);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 0.9rem 0.5rem;
	font: inherit;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.oq-dist-card:hover,
.oq-dist-card:focus-visible {
	background: var(--surface-3);
	border-color: var(--accent);
	color: var(--accent-hi);
}
.oq-dist-val {
	font-family: 'Cormorant Garamond', serif;
	font-size: 1.55rem;
	font-weight: 500;
	color: var(--text-strong);
	line-height: 1;
}
.oq-dist-card:hover .oq-dist-val,
.oq-dist-card:focus-visible .oq-dist-val { color: var(--accent-hi); }
.oq-dist-count {
	color: var(--text-muted);
	font-size: 0.78rem;
	margin-top: 0.1rem;
}
.oq-dist-tag {
	color: var(--text-dim);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	min-height: 1em;
}

/* Pseudo bar — only shown on Online branch. Persisted in localStorage. */
.oq-pseudo-bar {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 0.5rem 0.75rem;
	margin: 0 0 1rem;
}
.oq-pseudo-label {
	color: var(--text-muted);
	font-size: 0.85rem;
	white-space: nowrap;
}
.oq-pseudo-input {
	flex: 1;
	background: transparent;
	color: var(--text-strong);
	border: 0;
	border-bottom: 1px dashed var(--border);
	padding: 0.25rem 0.1rem;
	font: inherit;
	font-size: 0.95rem;
	min-width: 0;
}
.oq-pseudo-input:focus {
	outline: none;
	border-bottom-color: var(--accent);
}
.oq-pseudo-status {
	color: var(--accent-hi);
	font-size: 0.75rem;
	min-width: 4em;
}

@media (max-width: 560px) {
	.oq-branch-grid { grid-template-columns: 1fr; }
	.oq-panel { padding: 1.1rem 1rem; }
}

/* ---- Member dashboard (account modal) ---------------------------------- */
/* The dashboard needs more room than the 420px auth forms — widen the modal
   only when it hosts the dashboard. :has() falls back gracefully (table stays
   horizontally scrollable) on the rare engine without support. */
.auth-modal:has(.dash-tabs) { max-width: 680px; }

.dash-tabs {
	display: flex;
	gap: 0.25rem;
	border-bottom: 1px solid var(--border);
	margin-bottom: 0.85rem;
}
.dash-tab {
	background: transparent;
	border: 0;
	border-bottom: 2px solid transparent;
	color: var(--text-muted);
	font: inherit;
	font-size: 0.9rem;
	padding: 0.5rem 0.65rem;
	cursor: pointer;
	white-space: nowrap;
}
.dash-tab:hover { color: var(--text); }
.dash-tab.is-active {
	color: var(--text-strong);
	border-bottom-color: var(--accent);
}
.dash-content { min-height: 7rem; }
.dash-pane { overflow-x: auto; }

.dash-loading,
.dash-empty {
	color: var(--text-muted);
	font-size: 0.9rem;
	padding: 1.25rem 0;
	text-align: center;
}
.dash-streak {
	color: var(--text);
	font-size: 0.9rem;
	margin: 0 0 0.65rem;
}
.dash-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
}
.dash-table th,
.dash-table td {
	text-align: left;
	padding: 0.4rem 0.55rem;
	border-bottom: 1px solid var(--border);
	white-space: nowrap;
}
.dash-table th {
	color: var(--text-dim);
	font-weight: 600;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.dash-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.dash-row-actions {
	display: flex;
	gap: 0.6rem;
}
.dash-link {
	background: transparent;
	border: 0;
	color: var(--accent);
	font: inherit;
	font-size: 0.82rem;
	padding: 0;
	cursor: pointer;
	text-decoration: none;
}
.dash-link:hover { color: var(--accent-hi); text-decoration: underline; }

/* ---- Verified badge + clickable leaderboard player --------------------- */
.lb-player {
	color: var(--text);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
}
.lb-player:hover { color: var(--accent-hi); text-decoration: underline; }
.lb-verified {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1rem;
	height: 1rem;
	border-radius: 50%;
	background: var(--accent-dim);
	color: #fff;
	font-size: 0.7rem;
	line-height: 1;
	flex: 0 0 auto;
}
.oq-title .lb-verified { width: 1.3rem; height: 1.3rem; font-size: 0.9rem; margin-left: 0.5rem; vertical-align: middle; }

/* ---- Public profile (mounts in the #Quiz host) ------------------------- */
.profile-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 1.25rem 0;
}
.profile-stat {
	flex: 1 1 7rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 0.85rem 1rem;
	text-align: center;
}
.profile-stat-num {
	font-size: 1.6rem;
	font-weight: 700;
	color: var(--accent-hi);
	line-height: 1.1;
}
.profile-stat-label {
	font-size: 0.78rem;
	color: var(--text-muted);
	margin-top: 0.25rem;
}
.profile-level { margin: 1rem 0 0.5rem; }
.profile-level-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 0.35rem;
}
.profile-level-badge {
	font-weight: 700;
	color: var(--gold);
}
.profile-level-xp { font-size: 0.8rem; color: var(--text-muted); }
.profile-xpbar {
	height: 0.5rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 0.25rem;
	overflow: hidden;
}
.profile-xpbar-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--accent-dim), var(--accent-hi));
}

.profile-section {
	font-size: 1.05rem;
	color: var(--text-strong);
	margin: 1.5rem 0 0.6rem;
}
.profile-chal-list {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}
.profile-chal {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.6rem 0.85rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	text-decoration: none;
	color: var(--text);
}
.profile-chal:hover { border-color: var(--border-hi); color: var(--text-strong); }
.profile-chal-mode { font-weight: 600; }
.profile-chal-meta { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }

/* ---- Notifications bell (topbar) --------------------------------------- */
.notif-wrap { position: relative; display: inline-flex; }
.notif-bell {
	position: relative;
	background: transparent;
	border: 0;
	color: var(--text-muted);
	cursor: pointer;
	padding: 0.35rem;
	display: inline-flex;
	align-items: center;
}
.notif-bell:hover { color: var(--text); }
.notif-bell svg { width: 20px; height: 20px; }
.notif-count {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 1rem;
	height: 1rem;
	padding: 0 0.2rem;
	border-radius: 0.5rem;
	background: var(--danger);
	color: #fff;
	font-size: 0.65rem;
	font-weight: 700;
	line-height: 1rem;
	text-align: center;
}
.notif-menu {
	position: absolute;
	top: calc(100% + 0.4rem);
	right: 0;
	width: 18rem;
	max-width: 80vw;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	display: none;
	z-index: 60;
	overflow: hidden;
}
.notif-menu.open { display: block; }
.notif-menu-head {
	padding: 0.6rem 0.85rem;
	font-weight: 600;
	color: var(--text-strong);
	border-bottom: 1px solid var(--border);
}
.notif-list { max-height: 20rem; overflow-y: auto; }
.notif-empty { padding: 1rem 0.85rem; color: var(--text-muted); font-size: 0.85rem; text-align: center; }
.notif-item {
	display: block;
	padding: 0.6rem 0.85rem;
	color: var(--text);
	text-decoration: none;
	border-bottom: 1px solid var(--border);
	font-size: 0.85rem;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: rgba(255, 255, 255, 0.04); }
.notif-item.is-unread { background: var(--accent-glow); }
.notif-item.is-unread:hover { background: rgba(65, 219, 188, 0.26); }

/* ---- Avatar + bio ------------------------------------------------------ */
.auth-textarea { resize: vertical; min-height: 4.5rem; font-family: inherit; width: 100%; }
.avatar-preview {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	overflow: hidden;
	flex: 0 0 auto;
	border: 1px solid var(--border);
	background: var(--surface);
	display: flex;
	align-items: center;
	justify-content: center;
}
.avatar-preview.avatar-empty { color: var(--text-dim); }
.avatar-preview.avatar-empty svg { width: 32px; height: 32px; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* The avatar itself is the edit trigger: click / keyboard / drag-drop. A
   camera overlay fades in on hover so the affordance is obvious. */
.avatar-edit {
	position: relative;
	display: block;
	padding: 0;
	border: 0;
	background: none;
	border-radius: 50%;
	cursor: pointer;
}
.avatar-edit .avatar-preview {
	width: 84px;
	height: 84px;
	border: 2px solid var(--border-hi);
	transition: border-color 0.15s ease;
}
.avatar-edit-overlay {
	position: absolute;
	inset: 2px;
	border-radius: 50%;
	background: rgba(0, 3, 8, 0.62);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.15s ease;
	pointer-events: none;
}
.avatar-edit-overlay svg { width: 26px; height: 26px; }
.avatar-edit:hover .avatar-edit-overlay,
.avatar-edit:focus-visible .avatar-edit-overlay,
.avatar-edit.drag-over .avatar-edit-overlay { opacity: 1; }
.avatar-edit:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.avatar-edit.drag-over .avatar-preview { border-color: var(--accent); }
.avatar-remove-link { font-size: 0.75rem; }

/* avatar in the topbar user button */
.auth-avatar-img {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

/* avatar + bio on the public profile */
.profile-avatar {
	width: 96px;
	height: 96px;
	border-radius: 50%;
	overflow: hidden;
	margin: 0 auto 0.75rem;
	border: 2px solid var(--border-hi);
}
.profile-bio {
	color: var(--text);
	font-style: italic;
	margin: 0.25rem 0 0.75rem;
}

/* ---- Account settings: tabbed layout ----------------------------------- */
/* Wider than the auth forms so it reads across rather than down; the tabs cut
   the old one-long-scroll into three short panes. Still width:100% on mobile. */
.auth-modal:has(.acct-tabs) { max-width: 560px; }

.acct-tabs {
	display: flex;
	gap: 0.25rem;
	border-bottom: 1px solid var(--border);
	margin: 0.25rem 0 1rem;
	overflow-x: auto;
}
.acct-tab {
	background: transparent;
	border: 0;
	border-bottom: 2px solid transparent;
	color: var(--text-muted);
	font: inherit;
	font-size: 0.92rem;
	padding: 0.5rem 0.8rem;
	cursor: pointer;
	white-space: nowrap;
}
.acct-tab:hover { color: var(--text); }
.acct-tab.is-active { color: var(--text-strong); border-bottom-color: var(--accent); }

/* Each logical block is a card — visual grouping instead of bare headings. */
.acct-card {
	background: rgba(255, 255, 255, 0.025);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1rem 1rem 0.85rem;
	margin-bottom: 0.9rem;
}
.acct-card:last-child { margin-bottom: 0.25rem; }
.acct-card-title {
	margin: 0 0 0.75rem;
	font-family: var(--font-serif);
	font-size: 1.2rem;
	font-weight: 600;
	color: var(--text-strong);
}
.acct-card-danger {
	border-color: rgba(220, 53, 69, 0.4);
	background: rgba(220, 53, 69, 0.05);
}
.acct-card-title-danger { color: var(--danger); }

/* Profile card: avatar column + identity fields side by side. */
.acct-profile-head {
	display: flex;
	gap: 1.1rem;
	align-items: flex-start;
	margin-bottom: 0.4rem;
}
.acct-avatar-col {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	flex: 0 0 auto;
}
.acct-profile-id { flex: 1; min-width: 0; }
.acct-profile-id .auth-field { margin-bottom: 0.25rem; }
.acct-profile-id .auth-hint { margin-bottom: 0; }
.acct-handle {
	margin: 0 0 0.4rem;
	color: var(--text-dim);
	font-size: 0.85rem;
}
@media (max-width: 480px) {
	.acct-profile-head { flex-direction: column; align-items: center; }
	.acct-profile-id { width: 100%; }
}

/* Bio label row: label on the left, live x/300 counter on the right. */
.acct-label-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}
.acct-counter {
	font-size: 0.75rem;
	color: var(--text-dim);
	font-variant-numeric: tabular-nums;
}
.acct-counter.is-near { color: var(--gold); }

/* Email row: masked value + reveal toggle. */
.acct-email-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 0.85rem;
}
.acct-email-label { color: var(--text-muted); font-size: 0.85rem; }
.acct-email-val {
	font-family: var(--font-mono);
	color: var(--text-strong);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 0.15rem 0.5rem;
}
.auth-link-btn {
	background: transparent;
	border: 0;
	color: var(--accent);
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
	padding: 0;
	text-decoration: underline;
}
.auth-link-btn:hover { color: var(--accent-hi); }

/* The user-menu header is now a button (links to the public profile). Keep the
   existing padding/bottom-border from .auth-user-menu-head above; just reset
   the button chrome and flag it as clickable. */
.auth-user-menu-head {
	display: block;
	width: 100%;
	text-align: left;
	background: transparent;
	border-top: 0;
	border-left: 0;
	border-right: 0;
	font: inherit;
	cursor: pointer;
}
.auth-user-menu-head:hover { background: rgba(255, 255, 255, 0.04); }
.acct-profile-link { display: inline-block; margin: -0.25rem 0 0.85rem; }


/* =============================================================================
   Phase B — library sort/favorites, sticky compare bar, compare page extras
   (radar, tabs, general info, quiz CTA)
   ============================================================================= */
.library-controls-right {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}
.sort-select {
	font: inherit;
	font-size: 0.85rem;
	color: var(--text);
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 0.35rem 0.6rem;
	cursor: pointer;
}
.sort-select:hover { border-color: var(--border-hi); }

/* Sticky compare bar */
.compare-bar { flex-wrap: wrap; justify-content: center; }
.compare-bar-dots { display: inline-flex; gap: 0.3rem; }
.compare-bar-count {
	color: var(--text);
	font-size: 0.9rem;
	white-space: nowrap;
}

/* Compare page layout: main column + side column (radar, infos) */
.cmp-layout { display: block; }
@media (min-width: 1100px) {
	.cmp-layout.has-radar {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 320px;
		gap: 1.25rem;
		align-items: start;
	}
}
.cmp-side {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-top: 1rem;
}
@media (min-width: 1100px) { .cmp-side { margin-top: 0; } }
.cmp-side .panel { padding: 1.1rem 1.25rem; }
.cmp-side .panel-title { display: block; margin-bottom: 0.75rem; }

/* Radar */
.cmp-radar { display: block; width: 100%; height: auto; }
.radar-ring { fill: none; stroke: var(--border); }
.radar-axis { stroke: var(--border); }
.radar-label {
	fill: var(--text-muted);
	font-size: 10px;
	font-family: var(--font-sans);
}
.radar-poly {
	fill: var(--weapon-color, var(--accent));
	fill-opacity: 0.12;
	stroke: var(--weapon-color, var(--accent));
	stroke-width: 1.6;
	stroke-linejoin: round;
}
.radar-dot { fill: var(--weapon-color, var(--accent)); }
.cmp-radar-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1rem;
	margin-top: 0.5rem;
}
.cmp-radar-key {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.8rem;
	color: var(--text-muted);
}

/* Stat-group tabs */
.cmp-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 1.25rem 0 1rem;
}
.cmp-tab {
	padding: 0.4rem 0.9rem;
	border-radius: var(--radius);
	border: 1px solid var(--border);
	color: var(--text-muted);
	font-size: 0.85rem;
	font-weight: 600;
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.cmp-tab:hover { color: var(--text-strong); border-color: var(--border-hi); }
.cmp-tab.active {
	color: var(--accent-hi);
	border-color: var(--border-hi);
	background: var(--accent-glow);
}

/* General info rows */
.cmp-info-row {
	display: grid;
	grid-template-columns: 130px repeat(auto-fit, minmax(60px, 1fr));
	gap: 0.5rem;
	align-items: center;
	padding: 0.45rem 0;
	border-bottom: 1px solid var(--border);
	font-size: 0.88rem;
}
.cmp-info-row:last-child { border-bottom: none; }
.cmp-info-label { color: var(--text-muted); }
.cmp-info-value {
	color: var(--text);
	font-variant-numeric: tabular-nums;
	border-left: 2px solid var(--weapon-color, transparent);
	padding-left: 0.5rem;
	min-width: 0;
	overflow-wrap: anywhere;
}

/* Compare footer: about + share + quiz CTA */
.cmp-footer {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 1rem;
	align-items: start;
	margin-top: 1.5rem;
}
.cmp-footer .panel { padding: 1.1rem 1.25rem; }
.cmp-footer .panel-title { display: block; margin-bottom: 0.6rem; }
.cmp-about p { color: var(--text-muted); font-size: 0.88rem; }
.cmp-footer-actions { display: flex; align-items: flex-start; }
.cmp-quiz-panel { border-color: rgba(184, 145, 62, 0.35); }
.cmp-quiz-hint { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.75rem; }

/* Docked compare panel (library, wide screens). Hidden below 1400px — the
   sticky bar covers the same actions there. */
.compare-dock { display: none; }
@media (min-width: 1400px) {
	.compare-dock {
		display: block;
		position: fixed;
		top: calc(var(--topbar-h) + 1rem);
		right: 1rem;
		width: 330px;
		max-height: calc(100vh - var(--topbar-h) - 2rem);
		overflow-y: auto;
		background: var(--surface);
		border: 1px solid var(--border);
		border-radius: var(--radius-lg);
		padding: 1rem 1.1rem;
		z-index: 80;
	}
	.page:has(.compare-dock) { padding-right: 360px; }
	/* The sticky bar is redundant when the dock is visible. */
	.page:has(.compare-dock) .compare-bar { display: none; }
}
.compare-dock .panel-title { display: block; margin-bottom: 0.75rem; }
.dock-row {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.45rem 0;
	border-bottom: 1px solid var(--border);
}
.dock-row:last-of-type { border-bottom: none; }
.dock-slot { width: 20px; height: 20px; flex: 0 0 auto; border-radius: 50%; font-size: 0.7rem; }
.dock-thumb { width: 56px; max-height: 26px; object-fit: contain; flex: 0 0 auto; }
.dock-thumb.placeholder { height: 26px; background: var(--surface-3); border-radius: var(--radius-sm); }
.dock-row-text { display: flex; flex-direction: column; gap: 0.05rem; min-width: 0; flex: 1 1 auto; }
.dock-row-name {
	color: var(--text-strong);
	font-size: 0.88rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.dock-remove {
	color: var(--text-dim);
	font-size: 1.1rem;
	line-height: 1;
	padding: 0.2rem 0.35rem;
	border-radius: var(--radius-sm);
	flex: 0 0 auto;
}
.dock-remove:hover { color: var(--danger); background: var(--danger-dim); }
.dock-actions { margin-top: 0.85rem; }
.dock-actions .btn { width: 100%; text-align: center; }

/* =============================================================================
   Phase C — sidebar user card + stats overview panels
   ============================================================================= */
.sidebar-user-card {
	margin-top: auto;
	padding: 0.85rem 0.9rem;
	border-top: 1px solid var(--border);
	background: var(--surface);
	position: relative;   /* anchor for the account popup menu */
}
/* Clickable profile entry (bottom-left): hover/focus affordance. */
.sidebar-user-card.is-clickable {
	cursor: pointer;
	transition: background 0.12s ease;
}
/* Account menu, opens upward from the bottom-left card (replaces the old
   top-right user dropdown). */
.sidebar-user-menu {
	position: absolute;
	left: 0.5rem;
	right: 0.5rem;
	bottom: 100%;
	margin-bottom: 0.45rem;
	background: var(--surface-hi, var(--surface));
	border: 1px solid var(--border-hi, var(--border));
	border-radius: var(--radius);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
	overflow: hidden;
	z-index: 120;
}
.sidebar-user-menu-item {
	display: block;
	width: 100%;
	text-align: left;
	padding: 0.6rem 0.9rem;
	background: none;
	border: 0;
	color: var(--text);
	font: inherit;
	cursor: pointer;
}
.sidebar-user-menu-item + .sidebar-user-menu-item { border-top: 1px solid var(--border); }
.sidebar-user-menu-item:hover,
.sidebar-user-menu-item:focus-visible {
	background: var(--accent);
	color: var(--bg-deep);
	outline: none;
}
.sidebar-user-card.is-clickable:hover,
.sidebar-user-card.is-clickable:focus-visible {
	background: var(--surface-hi, var(--surface));
	outline: none;
}
.sidebar-user-card.is-clickable:focus-visible {
	box-shadow: inset 0 0 0 2px var(--accent);
}
.sidebar-user-head {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: 0.55rem;
}
.sidebar-avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid var(--border-hi);
	flex: 0 0 auto;
}
.sidebar-avatar.placeholder { background: var(--surface-3); display: inline-block; }
.sidebar-user-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.sidebar-user-name {
	color: var(--text-strong);
	font-size: 0.88rem;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.sidebar-user-level {
	color: var(--text-muted);
	font-size: 0.72rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.sidebar-ring-wrap { position: relative; width: 40px; height: 40px; flex: 0 0 auto; }
.sidebar-ring-label {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	font-size: 0.58rem;
	font-weight: 700;
	color: var(--gold-hi);
	font-variant-numeric: tabular-nums;
}
.sidebar-xpbar { margin-bottom: 0.25rem; }
.sidebar-xp-numbers {
	color: var(--text-dim);
	font-size: 0.7rem;
	font-variant-numeric: tabular-nums;
}

/* Stats overview panels */
.statov-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 1rem;
	margin-bottom: 1.5rem;
}
.statov-panel { padding: 1.1rem 1.25rem; }
.statov-panel .panel-title { display: block; margin-bottom: 0.75rem; }
.statov-row {
	display: grid;
	grid-template-columns: 92px 1fr 44px;
	align-items: center;
	gap: 0.6rem;
	padding: 0.3rem 0;
}
.statov-pct {
	font-size: 0.85rem;
	color: var(--text);
	font-variant-numeric: tabular-nums;
}
.statov-row .bar-fill[data-ammo="Compact"]      { background: var(--ammo-compact); }
.statov-row .bar-fill[data-ammo="Medium"]       { background: var(--ammo-medium); }
.statov-row .bar-fill[data-ammo="Long"]         { background: var(--ammo-long); }
.statov-row .bar-fill[data-ammo="Special Long"] { background: var(--ammo-special-long); }
.statov-row .bar-fill[data-ammo="Shotgun"]      { background: var(--ammo-shotgun); }
.statov-row .bar-fill[data-ammo="Special"]      { background: var(--ammo-special); }
.statov-run {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	padding: 0.35rem 0;
	border-bottom: 1px solid var(--border);
	font-size: 0.9rem;
}
.statov-run:last-child { border-bottom: none; }
.statov-run-mode { flex: 1 1 auto; color: var(--text); }
.statov-run-pct { color: var(--accent-hi); font-weight: 700; font-variant-numeric: tabular-nums; }
.statov-run-when { color: var(--text-dim); font-size: 0.78rem; white-space: nowrap; }
.statov-ach-row { display: flex; flex-direction: column; gap: 0.45rem; }
.statov-ach {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	font-size: 0.9rem;
	color: var(--text);
}
.statov-ach-icon { font-size: 1.1rem; }
.statov-ach.tier-gold .statov-ach-title,
.statov-ach.tier-platinum .statov-ach-title { color: var(--gold-hi); }

/* The menu is a flex column so the user card can sit at the bottom. */
.vertical-menu { display: flex; flex-direction: column; }
.vertical-menu > a { flex: 0 0 auto; }
.sidebar-user-card {
	margin-left: -0.85rem;
	margin-right: -0.85rem;
	margin-bottom: -1rem;
	padding-left: 1rem;
	padding-right: 1rem;
}

/* =============================================================================
   Quiz audit pass — picker header, mission-sheet config, play row (round play,
   visible waveform, distance panel), reveal cards v2, report standing panel
   ============================================================================= */

/* ---- Picker ---- */
.oq-picker-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 0.5rem;
	text-align: left;
}
.oq-picker-head .display-title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.oq-picker-head .display-sub { display: block; margin-top: 0.25rem; }
.oq-picker-head + .display-ornament { margin-bottom: 1.25rem; }
.oq-picker-grid {
	grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
	gap: 0.85rem;
}
.oq-picker-card { padding: 1.15rem 0.85rem 1rem; gap: 0.35rem; }
.oq-picker-card .mode-name { font-variant: small-caps; letter-spacing: 0.04em; }
.oq-mode-meta {
	color: var(--text-muted);
	font-size: 0.75rem;
	line-height: 1.35;
}
.oq-picker-more { text-align: center; margin-top: 1rem; }

/* ---- Mission config (narrow sheet) ---- */
.oq-config {
	max-width: 440px;
	margin: 0 auto;
}
.oq-config-title {
	display: block;
	text-align: center;
	margin-bottom: 1.25rem;
}
.oq-config-sec-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin: 1.4rem 0 0.6rem;
}
.oq-config-sec-row .oq-config-sec { margin: 0; }
.oq-config-all {
	color: var(--accent-hi);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.oq-config-all:hover { color: var(--accent); text-decoration: underline; }

.cfg-cat-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.5rem;
}
.cfg-cat-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.45rem;
	padding: 0.7rem 0.4rem 0.6rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
.cfg-cat-tile:hover { border-color: var(--border-hi); }
.cfg-cat-tile.is-on { background: var(--surface-2); border-color: var(--border-hi); }
.cfg-cat-tile:not(.is-on) { opacity: 0.55; }
.cfg-cat-dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--text-dim);
}
.cfg-cat-dot[data-ammo="Compact"]      { background: var(--ammo-compact); }
.cfg-cat-dot[data-ammo="Medium"]       { background: var(--ammo-medium); }
.cfg-cat-dot[data-ammo="Long"]         { background: var(--ammo-long); }
.cfg-cat-dot[data-ammo="Special Long"] { background: var(--ammo-special-long); }
.cfg-cat-dot[data-ammo="Shotgun"]      { background: var(--ammo-shotgun); }
.cfg-cat-dot[data-ammo="Special"]      { background: var(--ammo-special); }
.cfg-cat-name { font-size: 0.78rem; color: var(--text); }

.chip--wide {
	border-radius: var(--radius);
	padding: 0.5rem 1.15rem;
	font-size: 0.92rem;
	min-width: 56px;
	justify-content: center;
}
.chip--wide.is-on { background: var(--accent); color: var(--bg-deep); border-color: var(--accent); }

.oq-config-mode-seg { display: flex; width: 100%; }
.oq-config-mode-seg .seg-btn { flex: 1 1 0; text-align: center; }
/* Solo-only modes: the Online button stays visible but inert, so the rule
   "this challenge can't go online" is explicit rather than hidden. */
.oq-config-mode-seg .seg-btn.is-disabled {
	opacity: 0.4;
	cursor: not-allowed;
	pointer-events: none;
}
.oq-config-mode-note {
	text-align: center;
	font-size: 0.82rem;
	color: var(--text-dim);
	margin-top: 0.35rem;
}
/* Inline streamer title + the "won't count for the season" transparency note. */
.oq-chal-title-input { width: 100%; }
.oq-config-ledger-note {
	text-align: center;
	font-size: 0.82rem;
	color: var(--text-dim);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 0.5rem 0.8rem;
	margin-top: 0.6rem;
}

.oq-config-pool { text-align: center; }
.oq-config-start {
	width: 100%;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-weight: 700;
}
.oq-config-shortcuts { text-align: center; }

/* ---- Play screen ---- */
.quiz-head { align-items: stretch; }
.quiz-head-left { display: flex; flex-direction: column; gap: 0.15rem; justify-content: center; }
.quiz-head-mode {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--text-dim);
}
.quiz-head-right { display: flex; align-items: stretch; gap: 0.6rem; }
.quiz-head-block {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.15rem;
	padding: 0.3rem 0.8rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}
.quiz-head-label {
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--text-dim);
}
.quiz-head-block .scoreline { gap: 0.75rem; font-size: 0.95rem; }
.quiz-head-block .streak-chip { border: none; background: transparent; padding: 0; }
.streak-block:has(.streak-chip.hot) {
	border-color: rgba(184, 145, 62, 0.45);
	background: var(--gold-glow);
}

.play-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.25rem;
	flex-wrap: wrap;
	padding: 0.5rem 0;
}
.play-row .quiz-viz {
	flex: 1 1 220px;
	max-width: 380px;
	height: 64px;
	margin: 0;
	min-width: 160px;
}
.play-center {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.45rem;
	flex: 0 0 auto;
}
.play-btn-circle {
	width: 92px;
	height: 92px;
	border-radius: 50%;
	background: var(--accent);
	color: var(--bg-deep);
	font-size: 1.7rem;
	line-height: 1;
	display: grid;
	place-items: center;
	padding-left: 6px;            /* optically centre the triangle glyph */
	border: none;
	box-shadow: 0 0 24px var(--accent-glow), 0 0 0 6px rgba(65, 219, 188, 0.12);
	transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.2s ease;
}
.play-btn-circle:hover { background: var(--accent-hi); }
.play-btn-circle.playing {
	transform: scale(0.95);
	box-shadow: 0 0 36px rgba(65, 219, 188, 0.4), 0 0 0 9px rgba(65, 219, 188, 0.14);
}
.play-btn-caption {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-muted);
}
.play-row .quiz-dontknow { flex: 0 0 auto; }

.distance-panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.2rem;
	min-width: 130px;
	padding: 0.75rem 1.1rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	flex: 0 0 auto;
}
.distance-panel-label {
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--text-dim);
}
.distance-panel-value {
	font-family: var(--font-serif);
	font-size: 1.5rem;
	line-height: 1.1;
	color: var(--text-strong);
	font-variant-numeric: tabular-nums;
}
.distance-panel.locked .distance-panel-value { color: var(--text-muted); }
.distance-lock { font-size: 0.85rem; }
.distance-panel.revealed { border-color: var(--border-hi); }
.distance-panel.revealed .distance-panel-value { color: var(--accent-hi); animation: pulse 0.4s ease; }

.quiz-filter { justify-content: space-between; }
.quiz-filter-right {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-left: auto;
}
.guess-grid.text-only .guess-image { display: none; }

/* ---- Reveal cards v2 ---- */
.reveal-card.ok.big { padding: 1.25rem 1.5rem; }
.reveal-card-img.big {
	width: 200px;
	max-height: 88px;
}
.reveal-name.big {
	font-family: var(--font-serif);
	font-size: 1.45rem;
	display: block;
}
.reveal-dist-row {
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	margin-top: 0.8rem;
	padding-top: 0.7rem;
	border-top: 1px solid var(--border);
}
.reveal-dist-label {
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--text-dim);
}
.reveal-dist-value {
	color: var(--accent-hi);
	font-size: 1.1rem;
	font-variant-numeric: tabular-nums;
}
.reveal-chips { display: flex; gap: 0.6rem; margin-top: 0.8rem; flex-wrap: wrap; }
.reveal-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.3rem 0.85rem;
	border-radius: 999px;
	font-size: 0.88rem;
	font-weight: 700;
}
.reveal-chip.xp {
	background: var(--gold-glow);
	border: 1px solid rgba(184, 145, 62, 0.45);
	color: var(--gold-hi);
}
.reveal-chip.streak {
	background: var(--surface-2);
	border: 1px solid var(--border);
	color: var(--text);
}
.reveal-sub {
	margin: 0.6rem 0;
	padding: 0.6rem 0.8rem;
	border-radius: var(--radius);
	border: 1px solid var(--border);
	background: rgba(0, 3, 8, 0.25);
}
.reveal-sub.answer {
	border-color: rgba(53, 184, 123, 0.5);
	background: var(--success-dim);
}
.reveal-sub-label {
	display: block;
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--text-dim);
	margin-bottom: 0.35rem;
}
.reveal-sub-row {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	flex-wrap: wrap;
}
.reveal-mini-thumb {
	width: 84px;
	max-height: 34px;
	object-fit: contain;
	flex: 0 0 auto;
}
.reveal-sub-name { color: var(--text-strong); font-size: 1rem; }
.reveal-sub-name s { opacity: 0.75; }
.reveal-mark { margin-left: auto; font-weight: 800; }
.reveal-mark.ok { color: var(--success); }
.reveal-mark.ko { color: var(--danger); }
.reveal-actions .reveal-continue { width: 100%; }

/* ---- Report ---- */
.report { max-width: 760px; margin: 0 auto; }
.report-standing {
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.report-standing-value {
	font-family: var(--font-serif);
	font-size: 2.1rem;
	line-height: 1.1;
	color: var(--gold-hi);
	font-variant-numeric: tabular-nums;
}
.report-standing-sub {
	color: var(--text-muted);
	font-size: 0.82rem;
	margin-top: 0.2rem;
}
.report-xp-details { margin-top: 0.75rem; }
@media (min-width: 720px) {
	.report-grid { grid-template-columns: minmax(220px, 300px) 1fr; }
	.report-grid:has(.report-standing) { grid-template-columns: minmax(200px, 250px) 1fr minmax(170px, 200px); }
}

/* Unified online play screen leftovers */
.oq-visual-actions { justify-content: center; margin: 0.75rem 0; }
.oq-report .oq-lb { margin-top: 1.25rem; }
.oq-dontknow { flex: 0 0 auto; }

/* =============================================================================
   Profile page (merged Stats + mockup public profile)
   ============================================================================= */
.pf { max-width: 860px; }
.pf-head {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 0.75rem;
}
.pf-avatar {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid var(--accent);
	box-shadow: 0 0 14px var(--accent-glow);
	flex: 0 0 auto;
}
.pf-avatar.placeholder {
	display: inline-block;
	background:
		radial-gradient(circle at 50% 38%, var(--surface-3) 0 24%, transparent 25%),
		radial-gradient(circle at 50% 100%, var(--surface-3) 0 40%, transparent 41%),
		var(--surface-2);
}
.pf-head-text { flex: 1 1 auto; min-width: 0; }
.pf-name-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}
.pf-name { margin: 0; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.pf-title {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--gold-hi);
	margin-top: 0.1rem;
}
.pf-bio {
	color: var(--text-muted);
	font-size: 0.9rem;
	font-style: italic;
	margin-top: 0.3rem;
}
.pf-rank {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	flex: 0 0 auto;
}
.pf-rank-level {
	display: grid;
	place-items: center;
	min-width: 44px;
	height: 44px;
	padding: 0 0.5rem;
	border-radius: var(--radius);
	border: 1px solid rgba(184, 145, 62, 0.45);
	background: var(--gold-glow);
	color: var(--gold-hi);
	font-family: var(--font-serif);
	font-size: 1.5rem;
	font-variant-numeric: tabular-nums;
}
.pf-xp { margin-bottom: 1rem; }
.pf-xp .bar { margin-bottom: 0.25rem; }
.pf-xp-num {
	color: var(--text-dim);
	font-size: 0.75rem;
	font-variant-numeric: tabular-nums;
}
.pf-stats-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 0.75rem;
	margin-bottom: 1.25rem;
}
.pf-stat {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 0.7rem 0.9rem;
	text-align: center;
}
.pf-stat-num {
	font-family: var(--font-serif);
	font-size: 1.6rem;
	line-height: 1.15;
	color: var(--text-strong);
	font-variant-numeric: tabular-nums;
}
.pf-stat-label {
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--text-dim);
	margin-top: 0.15rem;
}
.pf-tabs { margin-bottom: 1.25rem; }
.pf-member { margin-top: 1rem; font-size: 0.85rem; }

/* History tab */
.pf-history {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 0.4rem 1.1rem;
}
.pf-history-row {
	display: grid;
	grid-template-columns: 1fr auto auto auto auto;
	align-items: baseline;
	gap: 0.9rem;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--border);
	font-size: 0.92rem;
}
.pf-history-row:last-child { border-bottom: none; }
.pf-history-mode { color: var(--text); }
.pf-history-score { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pf-history-streak { color: var(--gold-hi); font-size: 0.8rem; min-width: 3em; text-align: right; }

/* Overview tweaks: richer achievement badges + see-all link */
.statov-ach-text { display: flex; flex-direction: column; min-width: 0; }
.statov-ach-icon {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--surface-3);
	border: 1px solid var(--border);
	flex: 0 0 auto;
}
.statov-ach.tier-gold .statov-ach-icon,
.statov-ach.tier-platinum .statov-ach-icon {
	border-color: rgba(184, 145, 62, 0.45);
	background: var(--gold-glow);
}
.statov-ach-desc {
	color: var(--text-dim);
	font-size: 0.75rem;
	line-height: 1.3;
}
.statov-see-all {
	margin-top: 0.6rem;
	font-size: 0.82rem;
	width: 100%;
}

/* ---- Manage data dialog (reset categories) ---- */
.md-rows {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}
.md-row {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin: 0;
	padding: 0.35rem 0.2rem;
	border-bottom: 1px solid var(--border);
	cursor: pointer;
}
.md-row:last-child { border-bottom: none; }
.md-row-label { flex: 1 1 auto; }
.md-row-count { flex: 0 0 auto; font-size: 0.78rem; }
.md-actions {
	display: flex;
	justify-content: space-between;
	gap: 0.6rem;
}
.md-sync-note { color: var(--gold, #b8913e); }

/* Generic toast (window.__huntToast) — the site's alert() replacement. */
.ach-toast.hunt-toast {
	border-color: var(--border);
	background: var(--surface);
}
.ach-toast.hunt-toast .ach-toast-title { font-size: 0.9rem; }

/* ---- Value-guess modes (damage / muzzle velocity) ---- */
.oq-value-q { text-align: center; }
.oq-value-weapon { margin: 0.6rem 0 0.2rem; }
.oq-value-prompt { margin-top: 0; }
.oq-value-controls { max-width: 560px; margin: 1.25rem auto 0; }
.oq-value-slider { width: 100%; }
.oq-value-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	margin-top: 0.8rem;
}
.oq-value-num { width: 7.5rem; text-align: center; }
.oq-value-live { color: var(--text-dim); min-width: 5.5rem; text-align: left; }

/* ---- Styled confirm modal (window.__huntConfirm) ---- */
.hc-overlay {
	position: fixed;
	inset: 0;
	z-index: 2100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	background: rgba(6, 9, 11, 0.66);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	animation: reveal-backdrop-in 0.15s ease;
}
.hc-card {
	width: 100%;
	max-width: 440px;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--surface);
	padding: 1.2rem 1.4rem;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
	animation: reveal-in 0.2s ease;
}
.hc-title {
	font-weight: 700;
	margin-bottom: 0.5rem;
}
.hc-message {
	color: var(--text-dim);
	white-space: pre-line;
	line-height: 1.45;
	margin-bottom: 1rem;
}
.hc-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.6rem;
}

/* ---- Picker: "Daily challenges" gold section vs "Training" grid ---- */
.oq-daily-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.5rem 0 0.6rem;
}
.oq-daily-head-label {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.72rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--gold-hi);
}
.oq-daily-reset {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.72rem;
	color: var(--gold-dim);
}
.oq-daily-grid {
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	margin-bottom: 1.4rem;
}
.oq-mode-daily {
	border: 2px solid var(--gold);
	box-shadow: 0 0 26px -10px var(--gold-glow) inset;
}
.oq-mode-daily .oq-mode-ico { color: var(--gold-hi); }
.oq-mode-played { opacity: 0.6; }
.oq-mode-played-badge {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.68rem;
	padding: 0.16rem 0.5rem;
	border-radius: 999px;
	background: var(--gold-glow);
	color: var(--gold-hi);
}
.oq-section-label {
	font-size: 0.72rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--text-dim);
	margin: 0.4rem 0 0.7rem;
	border-top: 0.5px solid var(--border);
	padding-top: 0.95rem;
}
