/* Hypnotic Visualiser - styles. No web fonts or images; uses the theme's font. */

/* ------------------------------------------------------------------ *
 * Theme tokens
 * ------------------------------------------------------------------ */
.hvz-root {
	--hvz-accent: #b794ff;
	--hvz-bg: #110f26;
	--hvz-surface: #1b1838;
	--hvz-surface-2: #252149;
	--hvz-border: rgba(255, 255, 255, 0.12);
	--hvz-text: #ece9ff;
	--hvz-muted: #a8a3c7;
	--hvz-good: #34d399;
	--hvz-warn: #f87171;
	--hvz-stage: radial-gradient(ellipse at 50% 40%, #1f1b44 0%, #0b0a1c 75%);
}

/* ------------------------------------------------------------------ *
 * Divi-proof reset. Divi (and Divi Builder on other themes) styles
 * p, ol, headings and links inside modules, sometimes with ID-level
 * selectors, so the essentials are pinned here.
 * ------------------------------------------------------------------ */
.hvz-root, .hvz-root * { box-sizing: border-box !important; }
.hvz-root p, .hvz-root ol, .hvz-root li, .hvz-root dl, .hvz-root dt, .hvz-root dd,
.hvz-root h2, .hvz-root h3 {
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	line-height: 1.5 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
}
.hvz-root h2, .hvz-root h3 { color: var(--hvz-text) !important; font-family: inherit !important; }
.hvz-root button { font-family: inherit !important; text-transform: none !important; letter-spacing: normal !important; line-height: 1.2 !important; box-shadow: none; }
.hvz-root button::after, .hvz-root .hvz-btn::after { content: none !important; display: none !important; } /* Divi button arrow icons */
.hvz-root a.hvz-btn { color: var(--hvz-text) !important; text-decoration: none !important; }
.hvz-root a.hvz-btn-primary { color: #fff !important; }

/* ------------------------------------------------------------------ *
 * Card + layout
 * ------------------------------------------------------------------ */
.hvz-root {
	max-width: 980px;
	margin: 1.5rem auto;
	color: var(--hvz-text);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
}
.hvz-card {
	padding: clamp(1.1rem, 3vw, 2rem);
	border-radius: 22px;
	background: var(--hvz-bg);
	border: 1px solid var(--hvz-border);
}
.hvz-root .hvz-h { font-size: clamp(1.35rem, 3.2vw, 1.75rem) !important; font-weight: 600 !important; }
.hvz-root .hvz-lead { color: var(--hvz-muted); font-size: 1rem; max-width: 60ch; margin-top: 0.4rem !important; }
.hvz-root .hvz-footnote { margin-top: 1.1rem !important; font-size: 0.8rem; color: var(--hvz-muted); }
.hvz-root .hvz-h:focus { outline: none; }

.hvz-row { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-top: 1.2rem; }

/* ------------------------------------------------------------------ *
 * Buttons
 * ------------------------------------------------------------------ */
.hvz-root .hvz-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 46px;
	padding: 0.65rem 1.3rem !important;
	border-radius: 999px !important;
	border: 1px solid var(--hvz-border) !important;
	background: var(--hvz-surface) !important;
	color: var(--hvz-text) !important;
	font-size: 0.97rem !important;
	font-weight: 500 !important;
	cursor: pointer;
	transition: border-color 0.2s, transform 0.1s, filter 0.2s;
	-webkit-tap-highlight-color: transparent;
}
.hvz-root .hvz-btn:hover { border-color: var(--hvz-accent) !important; }
.hvz-root .hvz-btn:active { transform: scale(0.97); }
.hvz-root .hvz-btn:focus-visible, .hvz-root .hvz-pat:focus-visible, .hvz-root .hvz-swatch:focus-visible, .hvz-root .hvz-stage:focus-visible {
	outline: 3px solid var(--hvz-accent) !important;
	outline-offset: 3px;
}
.hvz-root .hvz-btn-primary {
	background: var(--hvz-accent) !important;
	border-color: var(--hvz-accent) !important;
	color: #fff !important;
	font-weight: 600 !important;
}
.hvz-root .hvz-btn-primary:hover { filter: brightness(1.08); }
.hvz-root .hvz-btn-quiet { background: transparent !important; color: var(--hvz-muted) !important; }
.hvz-root .hvz-wide { min-width: min(100%, 15rem); }
.hvz-root .hvz-btn-primary { color: #16112e !important; }
.hvz-root [hidden] { display: none !important; }
.hvz-root input, .hvz-root select { font-family: inherit !important; }

/* ------------------------------------------------------------------ *
 * Hypnotic Visualiser
 * ------------------------------------------------------------------ */
.hvz-root .hvz-head { margin-bottom: 1rem; }
.hvz-root .hvz-head:empty { display: none; }

/* Stage */
.hvz-root .hvz-stage {
	position: relative;
	width: 100%;
	height: var(--hvz-height, auto);
	aspect-ratio: 16 / 9;
	min-height: 240px;
	overflow: hidden;
	border-radius: 18px;
	background: #05040c;
	isolation: isolate;
	outline: none;
	user-select: none;
	-webkit-user-select: none;
}
.hvz-root[style*="--hvz-height"] .hvz-stage { aspect-ratio: auto; }
.hvz-root .hvz-stage:focus-visible { outline: 3px solid var(--hvz-accent) !important; outline-offset: 3px; }
.hvz-root .hvz-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; max-width: none !important; }
.hvz-root .hvz-dim { position: absolute; inset: 0; background: #000; pointer-events: none; opacity: 0.1; transition: opacity 0.3s; }

/* Full screen */
.hvz-root .hvz-stage:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; }
.hvz-root .hvz-stage:-webkit-full-screen { width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; }
.hvz-root.is-session .hvz-stage:not(:fullscreen) { cursor: default; }
.hvz-root.is-session .hvz-stage:fullscreen:not(.is-awake):not(.is-paused) { cursor: none; }

/* Countdown / finish overlay */
.hvz-root .hvz-overlay {
	position: absolute; inset: 0; z-index: 3;
	display: none;
	flex-direction: column; align-items: center; justify-content: center; gap: 0.7rem;
	padding: 1.5rem; text-align: center; color: #f3f0ff;
	background: radial-gradient(ellipse at center, rgba(5, 4, 12, 0.35), rgba(5, 4, 12, 0.7));
}
.hvz-root .hvz-overlay.is-on { display: flex; animation: hvz-in 0.6s ease both; }
.hvz-root .hvz-overlay.is-end { background: rgba(5, 4, 12, 0.72); }
.hvz-root .hvz-ov-msg { font-size: clamp(1.05rem, 2.6vw, 1.45rem) !important; font-weight: 500; color: #f3f0ff !important; }
.hvz-root .hvz-ov-num { font-size: clamp(2.6rem, 9vw, 4.8rem) !important; font-weight: 300; line-height: 1.1 !important; color: #fff !important; font-variant-numeric: tabular-nums; }
.hvz-root .hvz-ov-sub { max-width: 42ch; color: rgba(243, 240, 255, 0.82) !important; font-size: 0.98rem; }
.hvz-root .hvz-overlay .hvz-btn-quiet { color: rgba(243, 240, 255, 0.85) !important; border-color: rgba(255, 255, 255, 0.3) !important; }
.hvz-root .hvz-overlay .hvz-btn:not(.hvz-btn-primary):not(.hvz-btn-quiet) { background: rgba(20, 16, 42, 0.8) !important; color: #f3f0ff !important; border-color: rgba(255, 255, 255, 0.3) !important; }
@keyframes hvz-in { from { opacity: 0; } to { opacity: 1; } }

/* Time left + progress */
.hvz-root .hvz-hud {
	position: absolute; top: 0.8rem; right: 1rem; z-index: 2;
	font-size: 0.85rem; color: rgba(255, 255, 255, 0.55);
	font-variant-numeric: tabular-nums; pointer-events: none;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.hvz-root .hvz-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 2; background: rgba(255, 255, 255, 0.06); pointer-events: none; }
.hvz-root .hvz-bar span { display: block; height: 100%; width: 0; background: rgba(255, 255, 255, 0.28); }
.hvz-root:not(.is-session) .hvz-bar, .hvz-root:not(.is-session) .hvz-hud { display: none; }

/* Live controls - only in a session, fading away when not needed */
.hvz-root .hvz-live {
	position: absolute; left: 50%; bottom: 1rem; z-index: 4;
	display: flex; flex-wrap: wrap; justify-content: center; gap: 0.45rem;
	width: max-content; max-width: calc(100% - 1.5rem);
	padding: 0.45rem; border-radius: 999px;
	background: rgba(8, 6, 20, 0.62);
	backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
	transform: translate(-50%, 0.6rem);
	opacity: 0; pointer-events: none;
	transition: opacity 0.5s, transform 0.5s;
}
.hvz-root:not(.is-session) .hvz-live, .hvz-root .hvz-overlay.is-on ~ .hvz-live { display: none; }
.hvz-root .hvz-stage.is-awake .hvz-live, .hvz-root .hvz-stage.is-paused .hvz-live, .hvz-root .hvz-live:focus-within {
	opacity: 1; pointer-events: auto; transform: translate(-50%, 0);
}
.hvz-root .hvz-live .hvz-btn {
	min-height: 40px; padding: 0.45rem 0.95rem !important; font-size: 0.88rem !important;
	background: rgba(255, 255, 255, 0.08) !important; color: #f3f0ff !important; border-color: rgba(255, 255, 255, 0.18) !important;
}
.hvz-root .hvz-live .hvz-btn-quiet { background: transparent !important; color: rgba(243, 240, 255, 0.75) !important; }
.hvz-root .hvz-stage.is-paused::before {
	content: "Paused"; position: absolute; top: 0.8rem; left: 1rem; z-index: 2;
	font-size: 0.85rem; color: rgba(255, 255, 255, 0.7); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.hvz-root .hvz-toast {
	position: absolute; top: 50%; left: 50%; z-index: 4;
	transform: translate(-50%, -50%);
	padding: 0.5rem 1rem; border-radius: 999px;
	background: rgba(8, 6, 20, 0.7); color: #f3f0ff; font-size: 0.95rem;
	opacity: 0; pointer-events: none; transition: opacity 0.3s;
	font-variant-numeric: tabular-nums;
}
.hvz-root .hvz-toast.is-on { opacity: 1; }

/* Control panel */
.hvz-root.is-session .hvz-panel { display: none; }
.hvz-root .hvz-panel { display: grid; gap: 1.3rem; margin-top: 1.3rem; }
.hvz-root .hvz-section { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.hvz-root .hvz-section.hvz-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0.8rem 1.4rem; }
.hvz-root .hvz-section.hvz-two > .hvz-label { grid-column: 1 / -1; }
.hvz-root .hvz-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase !important; letter-spacing: 0.08em !important; color: var(--hvz-muted); }

.hvz-root .hvz-patterns { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.6rem; }
.hvz-root .hvz-pat {
	display: flex; flex-direction: column; gap: 0.35rem; align-items: stretch;
	padding: 0.35rem 0.35rem 0.5rem !important; margin: 0 !important;
	border-radius: 12px !important; border: 2px solid transparent !important;
	background: var(--hvz-surface) !important; color: var(--hvz-text) !important;
	font-size: 0.85rem !important; text-align: center; cursor: pointer;
	transition: border-color 0.2s, transform 0.15s;
}
.hvz-root .hvz-pat:hover { border-color: var(--hvz-border) !important; transform: translateY(-1px); }
.hvz-root .hvz-pat.is-on { border-color: var(--hvz-accent) !important; }
.hvz-root .hvz-thumb { display: block; width: 100% !important; height: auto !important; aspect-ratio: 16 / 10; border-radius: 8px; max-width: none !important; }

.hvz-root .hvz-seg { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; align-self: flex-start; padding: 0.25rem; border-radius: 999px; background: var(--hvz-surface); }
.hvz-root .hvz-seg:empty { display: none; }
.hvz-root .hvz-seg-btn {
	min-height: 36px; padding: 0.35rem 0.9rem !important; border-radius: 999px !important;
	border: 0 !important; background: transparent !important; color: var(--hvz-muted) !important;
	font-size: 0.87rem !important; cursor: pointer;
}
.hvz-root .hvz-seg-btn.is-on { background: var(--hvz-surface-2) !important; color: var(--hvz-text) !important; box-shadow: inset 0 0 0 1px var(--hvz-accent); }
.hvz-root .hvz-seg-btn:focus-visible { outline: 2px solid var(--hvz-accent) !important; outline-offset: 2px; }

.hvz-root .hvz-swatches { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hvz-root .hvz-swatch {
	display: inline-flex; align-items: center; gap: 0.5rem;
	min-height: 40px; padding: 0.3rem 0.85rem 0.3rem 0.35rem !important; margin: 0 !important;
	border-radius: 999px !important; border: 2px solid transparent !important;
	background: var(--hvz-surface) !important; color: var(--hvz-text) !important;
	font-size: 0.87rem !important; cursor: pointer;
}
.hvz-root .hvz-swatch:hover { border-color: var(--hvz-border) !important; }
.hvz-root .hvz-swatch.is-on { border-color: var(--hvz-accent) !important; }
.hvz-root .hvz-dot { width: 28px; height: 28px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); }
.hvz-root .hvz-custom { display: none; flex-wrap: wrap; gap: 0.6rem 1.2rem; }
.hvz-root .hvz-custom.is-on { display: flex; }
.hvz-root .hvz-color { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--hvz-text); cursor: pointer; }
.hvz-root .hvz-color input[type="color"] { width: 44px; height: 34px; padding: 0 !important; margin: 0 !important; border: 1px solid var(--hvz-border) !important; border-radius: 8px; background: transparent !important; cursor: pointer; }

.hvz-root .hvz-slider { display: flex; flex-direction: column; gap: 0.35rem; }
.hvz-root .hvz-slider-top { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.93rem; color: var(--hvz-text); }
.hvz-root .hvz-slider-top output { color: var(--hvz-accent); font-weight: 600; }
.hvz-root input[type="range"] { width: 100%; margin: 0 !important; padding: 0 !important; accent-color: var(--hvz-accent); background: transparent !important; border: 0 !important; height: 28px; }

.hvz-root .hvz-length { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.hvz-root .hvz-select, .hvz-root .hvz-input {
	min-height: 44px; padding: 0.5rem 0.8rem !important; margin: 0 !important;
	border-radius: 10px !important; border: 1px solid var(--hvz-border) !important;
	background: var(--hvz-surface) !important; color: var(--hvz-text) !important;
	font-size: 0.95rem !important; line-height: 1.3 !important; box-shadow: none !important;
	max-width: 100%;
}
.hvz-root .hvz-select { flex: 1 1 260px; }
.hvz-root .hvz-select option { background: #1b1838; color: #ece9ff; }
.hvz-root .hvz-input { width: 7.5em; text-align: center; font-variant-numeric: tabular-nums; }
.hvz-root .hvz-select:focus, .hvz-root .hvz-input:focus { outline: 2px solid var(--hvz-accent) !important; outline-offset: 1px; }
.hvz-root .hvz-or { font-size: 0.85rem; color: var(--hvz-muted); }
.hvz-root .hvz-quick { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.hvz-root .hvz-chip { min-height: 36px; padding: 0.35rem 0.85rem !important; font-size: 0.85rem !important; }
.hvz-root .hvz-err { font-size: 0.85rem; color: var(--hvz-warn); }
.hvz-root .hvz-err:empty { display: none; }

.hvz-root .hvz-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 0.6rem 1.4rem; }
.hvz-root .hvz-inline { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; font-size: 0.93rem; color: var(--hvz-text); grid-column: 1 / -1; max-width: 420px; }
.hvz-root .hvz-small-select { flex: 0 0 auto; min-height: 38px; padding: 0.3rem 0.6rem !important; }
.hvz-root .hvz-check { display: flex; align-items: center; gap: 0.6rem; font-size: 0.93rem; color: var(--hvz-text); cursor: pointer; }
.hvz-root .hvz-check input { width: 20px; height: 20px; margin: 0 !important; accent-color: var(--hvz-accent); flex: none; }

.hvz-root .hvz-go { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; padding-top: 0.4rem; border-top: 1px solid var(--hvz-border); }
.hvz-root .hvz-start { min-width: min(100%, 16rem); min-height: 52px; font-size: 1.05rem !important; margin-top: 0.8rem; }
.hvz-root .hvz-note { max-width: 62ch; text-align: center; font-size: 0.85rem; color: var(--hvz-muted); }
.hvz-root .hvz-care { font-size: 0.78rem; opacity: 0.85; }
.hvz-root .hvz-row { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-top: 0.6rem !important; }

@media (max-width: 520px) {
	.hvz-root .hvz-stage { aspect-ratio: 4 / 5; border-radius: 14px; }
	.hvz-root[style*="--hvz-height"] .hvz-stage { aspect-ratio: auto; }
	.hvz-root .hvz-patterns { grid-template-columns: repeat(3, 1fr); gap: 0.45rem; }
	.hvz-root .hvz-pat { font-size: 0.76rem !important; }
	.hvz-root .hvz-live .hvz-btn { padding: 0.4rem 0.7rem !important; font-size: 0.82rem !important; }
}
@media (prefers-reduced-motion: reduce) {
	.hvz-root .hvz-overlay.is-on { animation: none; }
	.hvz-root .hvz-pat:hover { transform: none; }
}
