

/* ── LOADING OVERLAY ── */

#loadingOverlay {
	display: none;
	position: fixed;
	inset: 0;
	background: var(--bg);
	z-index: 100;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 20px;
}

#loadingOverlay p {
	font-size: 0.8rem;
	letter-spacing: 0.1em;
	color: #6a5e48;
}

#loadingOverlay .spinner {
	width: 32px;
	height: 32px;
	border: 2px solid #2a2418;
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.app-notice {
	min-height: 1.2em;
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8a7b60;
	text-align: center;
}

.app-notice.is-warning { color: var(--accent); }
.app-notice.is-error   { color: #f08a8a; }



/* === PROMPTER === */

#prompter {
	display: none;
	position: fixed;
	inset: 0;
	background: var(--bg);
	overflow: hidden;
}

#scrollContainer {
	height: 100vh;
	overflow-y: auto;
	overflow-x: hidden;
	scroll-behavior: smooth;
	display: flex;
	flex-direction: column;
	align-items: center;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

#scrollContainer::-webkit-scrollbar { display: none; }

#textPad {
	padding: 28vh 24px;
	width: var(--text-width);
	max-width: 100%;
}

#promptText {
	font-family: 'Lora', serif;
	font-size: var(--font-size);
	line-height: 1.2;
	color: var(--text-color);
	white-space: pre-wrap;
	word-break: break-word;
}

#promptText .word { display: inline; border-radius: 4px; transition: color 0.3s, background 0.3s; }
#promptText .word.passed { color: var(--passed); }
#promptText .word.active { color: var(--highlight); background: var(--highlight-bg); }

#guide {
	position: fixed;
	left: 0; right: 0;
	top: 28%;
	transform: translateY(-28%);
	height: calc(var(--font-size) * 1.6 + 8px);
	background: rgba(245, 192, 48, 0.03);
	border-top: 1px solid rgba(245, 192, 48, 0.08);
	border-bottom: 1px solid rgba(245, 192, 48, 0.08);
	pointer-events: none;
	z-index: 1;
}

.fade-top, .fade-bottom {
	position: fixed;
	left: 0; right: 0;
	height: 180px;
	pointer-events: none;
	z-index: 2;
}
.fade-top    { top: 0;    background: linear-gradient(to bottom, var(--bg) 30%, transparent); }
.fade-bottom { bottom: 0; background: linear-gradient(to top,   var(--bg) 30%, transparent); }

/* ── PANEL ── */
#panel {
	position: fixed;
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--panel-bg);
	border: 1px solid var(--panel-border);
	border-radius: 50px;
	padding: 10px 18px;
	backdrop-filter: blur(12px);
	transition: opacity 0.4s;
}

#panel.hidden { opacity: 0; pointer-events: none; }

.panel-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	background: var(--btn-bg);
	border: 1px solid var(--panel-border);
	border-radius: 50%;
	color: var(--text-color);
	cursor: pointer;
	font-size: 1rem;
	transition: background 0.2s, color 0.2s;
	flex-shrink: 0;
}

.panel-btn:hover { background: var(--btn-hover); }

.panel-btn.active-mic {
	background: rgba(224, 80, 80, 0.15);
	border-color: var(--red);
	color: var(--red);
	animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(224,80,80,0.4); }
	50%       { box-shadow: 0 0 0 6px rgba(224,80,80,0); }
}

.divider { width: 1px; height: 24px; background: var(--panel-border); }

.panel-slider-wrap { display: flex; align-items: center; gap: 8px; }

.panel-label {
	font-size: 0.6rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #5a5040;
}

input[type="range"].panel-range { width: 80px; height: 2px; }

#statusDot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #3a3530;
	flex-shrink: 0;
}

#statusDot.listening { background: var(--green); }
#statusDot.error     { background: var(--red); }

#hideHint {
	position: fixed;
	top: 16px;
	right: 20px;
	font-size: 0.6rem;
	letter-spacing: 0.1em;
	color: #3a3530;
	z-index: 10;
	cursor: pointer;
	text-transform: uppercase;
	transition: color 0.2s;
	background: transparent;
	border: none;
	padding: 0;
	font-family: inherit;
}

#hideHint:hover { color: #6a5e48; }

#transcript {
	position: fixed;
	top: 16px;
	left: 20px;
	font-size: 1rem;
	color: #aaa;
	z-index: 10;
	max-width: 400px;
	line-height: 1.4;
}

.session-notice {
	position: fixed;
	top: 44px;
	left: 20px;
	max-width: 420px;
	text-align: left;
	z-index: 10;
}
