:root { interpolate-size: allow-keywords; /* Разрешает браузеру анимировать ключевые слова размеров */ }
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: Arial, sans-serif;
	background: linear-gradient(135deg, #87CEEB 0%, #B0E0E6 50%, #E0F6FF 100%);
	min-height: 100vh;
	overflow: hidden;
}

.quiz-container {
	display: flex;
	height: 100vh;
	position: relative;
}

.background-pattern, .background-blank, .background-s3, .background-l, .background-start {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	z-index: 0;
	background-repeat: no-repeat;
}

.background-pattern {
	background-image: url('/resources/background.jpg');
	background-size: cover;
	opacity: .2;
}

.background-blank {
	background-image: url('/resources/bg.png');
	background-size: cover;
	background-position: right center;
	opacity: .75;
}

.background-s3 {
	background-image: url('/resources/s3.png');
	background-size: contain;
	background-position: left center;
}

.background-l {
	background-image: url('/resources/l.png');
	background-size: contain;
	background-position: left center;
}

.background-start {
	background-image: url('/resources/start.png');
	background-size: contain;
	background-position: left center;
}

.question-panel {
	flex: 1;
	padding: 40px;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	z-index: 1;
	position: relative;
}

.question-panel .question-title {
	background: #bfeaf9;
	box-shadow: 0 4px 10px 3px rgba(0, 0, 0, 0.5);
	font-size: 24px;
	color: black;
	margin-bottom: 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.question-panel .question-title p { padding: 20px 10px 20px 30px; flex: 1; }

.question-title a.audio-play-btn {
	display: block;
	width: 50px;
	height: 50px;
	margin-right: 30px;
	background: url('/resources/audio.png');
	background-size: cover;
	border-radius: 50px;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 4px 10px rgba(107, 155, 210, 0.3);
}
.question-title a.audio-play-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 15px rgba(107, 155, 210, 0.4);
}

a.help-audio-play-btn {
	display: inline-block;
	width: 30px;
	height: 30px;
	margin-right: 5px;
	background: url('/resources/audio.png');
	background-size: cover;
	border-radius: 50px;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 4px 10px rgba(107, 155, 210, 0.3);
	position: relative;
	top: 6px;
}
a.help-audio-play-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 15px rgba(107, 155, 210, 0.4);
}


.question-panel .question-text {
	background: #bfeaf9;
	padding: 20px 30px;
	box-shadow: 0 4px 10px 3px rgba(0, 0, 0, 0.5);
	font-size: 20px;
	color: black;
	margin-bottom: 20px;
	overflow-y: auto;
}

.question-text table {
	border-collapse: collapse;
}

.question-text p + table {
	margin-top: 20px;
}

.question-text h4 {
	margin-top: 20px;
	margin-bottom: 10px;
}

.question-text table td, .question-text table th {
	border: 1px solid black;
	padding: 5px 10px;
}

.control-panel {
	width: 350px;
	background: rgba(220, 220, 220, 1);
	padding: 30px;
	display: flex;
	flex-direction: column;
	border-radius: 50px;
	box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.3),
		inset -2px 2px 4px rgba(255, 255, 255, 0.5),
		inset 2px -2px 4px 1px rgba(0, 0, 0, 0.3);
	z-index: 1;
	position: relative;
	margin: 20px;
	border: 7px solid white;
	align-items: center;
	justify-content: space-between;
	overflow-y: auto;
}

.main-buttons-section {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ready-section, .listen-section {
	margin-bottom: 15px;
}

.ready-section h3 {
	font-size: 20px;
	color: #000;
	margin-bottom: 10px;
	font-style: italic;
	text-align: center;
}

.record-btn {
	width: 250px;
	background: #f70000;
	color: white;
	border: 3px solid white;
	padding: 12px 20px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: bold;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0px 0px 3px 1px rgb(0 0 0 / 30%), inset 2px -2px 3px 2px rgba(0, 0, 0, .3);
}

.record-btn:disabled {
	cursor: not-allowed;
}

.record-btn:not(:disabled):hover {
	background: #FF2222;
	transform: translateY(-2px);
	box-shadow: 0 6px 15px rgba(255, 68, 68, 0.4);
}

.action-btn {
	width: 250px;
	background: #2c7ebd;
	color: white;
	border: 3px solid white;
	padding: 12px 20px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: bold;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0px 0px 3px 1px rgb(0 0 0 / 30%), inset 2px -2px 3px 2px rgba(0, 0, 0, .3);
}

.action-btn:disabled {
	cursor: not-allowed;
	opacity: .3;
}

.action-btn:not(:disabled):hover {
	background: #357ABD;
	transform: translateY(-2px);
	box-shadow: 0 6px 15px rgba(74, 144, 226, 0.4);
}

.control-buttons {
	display: flex;
	justify-content: center;
	gap: 20px;
	margin-top: 8px;
}

.control-btn {
	background: conic-gradient(from 102deg, #dfdfdf 0% 43%, #43434338 0% 50%, #e7e7e7 0% 94%, #e9e9e9c9 0%);
	background-color: white;
	color: black;
	border: none;
	padding: 8px 16px;
	font-size: 12px;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: -1px 1px 5px 1px rgb(0 0 0 / 30%);
}

.control-btn:disabled {
	cursor: not-allowed;
	opacity: .3;
}

.control-btn:not(:disabled):hover {
	transform: translateY(-1px);
}

.help-section {
	margin-top: 10px;
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 200px;
}

.help-section > div {
	flex: 1;
	overflow-y: auto;
}

.help-section h3 {
	font-size: 20px;
	color: #000;
	margin-bottom: 15px;
	font-style: italic;
	text-align: center;
}

.help-list {
	width: calc(100% - 5px);
	list-style: none;
	padding: 0;
}

.help-list li {
	background: white;
	margin-bottom: 8px;
	padding: 10px 15px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: bold;
	color: #555;
	border-left: 4px solid #FF4444;
	cursor: pointer;
	transition: all 0.3s ease;
}

.help-list li:hover {
	background: #f8f8f8;
	transform: translateX(5px);
}

.back-btn, .prev-q-btn, .next-q-btn, .check-l-btn, .reset-l-btn, .check-l2-btn, .reset-l2-btn {
	width: fit-content;
	text-decoration: none;
	background: #6B9BD2;
	color: white;
	border: none;
	padding: 12px 20px;
	border-radius: 25px;
	font-size: 14px;
	font-weight: bold;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 10px;
	transition: all 0.3s ease;
	box-shadow: 0 4px 10px rgba(107, 155, 210, 0.3);
}

.check-l-btn, .check-l2-btn { background: #62b149; }

.check-l-btn:disabled, .reset-l-btn:disabled, .check-l2-btn:disabled, .reset-l2-btn:disabled {
	cursor: not-allowed;
	opacity: .5;
}

.back-btn:hover, .prev-q-btn[href]:hover, .next-q-btn[href]:hover,
.check-l-btn:not(:disabled):hover, .reset-l-btn:not(:disabled):hover,
.check-l2-btn:not(:disabled):hover, .reset-l2-btn:not(:disabled):hover {
	background: #5A8BC4;
	transform: translateY(-2px);
	box-shadow: 0 6px 15px rgba(107, 155, 210, 0.4);
}
.check-l-btn:not(:disabled):hover,
.check-l2-btn:not(:disabled):hover { background: #428f29; }

.prev-q-btn:not([href]), .next-q-btn:not([href]) {
	cursor: not-allowed;
	opacity: .5;
}

.back-icon {
	width: 20px;
	height: 20px;
}

.popup-background {
	display: none;
	position: absolute;
	width: 100%;
	height: 100vh;
	background: rgba(0, 0, 0, .7);
	z-index: 3;
	}

.popup-wrapper {
	display: flex;
	justify-content: center;
	align-items: center;
	position: absolute;
	height: 100vh;
	width: 100vw;
	padding: 40px;
}

.popup-panel {
	display: none;
	flex-direction: column;
	justify-content: space-between;
	max-height: calc(100vh - 40px);
	min-height: 30vh;
	width: max-content;
	height: max-content;
	z-index: 4;
	gap: 10px;
	padding: 30px 50px;
	border: 7px solid white;
	border-radius: 50px;
	background: rgba(220, 220, 220, 1);
	box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.3),
		inset -2px 2px 4px rgba(255, 255, 255, 0.5),
		inset 2px -2px 4px 1px rgba(0, 0, 0, 0.3);
	transition: all .5s ease-in-out;
}

.popup-content {
	display: none;
	flex: 1;
	flex-direction: column;
	font-size: 24px;
	overflow-y: auto;
}

.popup-content#transcription-output,
.popup-content#check-output { font-size: 32px; }

.popup-content ul, .popup-content ol {
	margin-top: 10px;
	margin-left: 2em;
}

.popup-content h3 {
	margin-bottom: 15px;
}

.popup-content p {
	margin-bottom: 15px;
}

.popup-content p.is-image-flex {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 20px;
}

.popup-content li {
	margin-bottom: 5px;
}


.popup-content table {
	border-collapse: collapse;
}

.popup-content table td, .popup-content table th {
	border: 1px solid black;
	padding: 5px 10px;
}


.popup-content table td p { margin-bottom: 10px; }
.popup-content table td p:last-child { margin-bottom: 0; }

p.response-question {
	font-style: italic;
	color: #003887;
	font-weight: 600;
}
.response-container {
	display: flex;
	gap: 24px;
	margin-top: 16px;
	flex-wrap: wrap;
}
.response-card {
	flex: 1;
	min-width: 600px;
	background: #f9fafb;
	border-radius: 12px;
	padding: 16px;
	border: 1px solid #e5e7eb;
	transition: box-shadow 0.2s;
}
.response-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.response-title {
	font-size: 1.5rem;
	font-weight: 600;
	margin: 0 0 4px 0;
	color: #1f2937;
}
.response-sub {
	font-size: 1rem;
	color: #4b5563;
	margin-bottom: 12px;
	border-left: 3px solid #3b82f6;
	padding-left: 8px;
}
.response-text { line-height: 1.5; color: #1e293b; margin: 0; }
.response-text p { margin: 0 0 8px 0; }
.response-text p:last-child { margin-bottom: 0; }

.close-btn {
	background: #6B9BD2;
	color: white;
	border: none;
	padding: 12px 20px;
	border-radius: 25px;
	font-size: 14px;
	font-weight: bold;
	cursor: pointer;
	margin-top: 10px;
	transition: all 0.3s ease;
	box-shadow: 0 4px 10px rgba(107, 155, 210, 0.3);
}

.close-btn:hover {
	background: #5A8BC4;
	transform: translateY(-2px);
	box-shadow: 0 6px 15px rgba(107, 155, 210, 0.4);
}

.central-container {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
}

.login-panel {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 30px 50px;
	z-index: 1;
	border: 7px solid white;
	border-radius: 50px;
	background: rgba(220, 220, 220, 1);
	box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.3),
		inset -2px 2px 4px rgba(255, 255, 255, 0.5),
		inset 2px -2px 4px 1px rgba(0, 0, 0, 0.3);
}

span.is-check-error, span.is-check-suggestion { color: darkred; font-style: italic; text-decoration: underline; }
span.is-check-suggestion { color: darkgoldenrod; }
span.is-check-suggest { color: darkgreen; font-style: italic; }

/* Панель со списком вопросов */
.questions-panel {
	background: rgba(220, 220, 220, .4);
	padding: 30px 40px;
	height: 100vh;
	overflow-y: auto;
	z-index: 1;
	position: relative;
	width: calc(100% - 250px);
}

/* Заголовок панели */
.questions-panel h2 {
	color: #236292;
	font-size: 28px;
}

.questions-panel h3 {
	font-size: 20px;
	margin-bottom: 15px;
	font-style: italic;
}

/* Список вопросов */
.questions-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

/* Элемент списка */
.questions-list li {
	margin-bottom: 10px;
}

/* Ссылка-кнопка */
.questions-list a {
	display: block;
	background: white;
	padding: 18px 25px;
	border-radius: 12px;
	font-size: 20px;
	font-weight: 600;
	color: #1a3e5c;
	text-decoration: none;
	border-left: 6px solid #2c7ebd; /* Синий акцент, как у основных кнопок */
	transition: all 0.3s ease;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	line-height: 1.4;
	word-break: break-word;
}

/* Эффект при наведении */
.questions-list a:hover {
	background: #e6f2ff;
	transform: translateX(10px);
	box-shadow: 0 8px 16px rgba(44, 126, 189, 0.3);
	border-left-color: #1e5f9e;
}

.variant-header {
	display: flex;
	align-items: center;
	margin-bottom: 25px;
	gap: 20px;
}
.variant-label {
	background: #87cce1;
	padding: 10px 15px;
	border-radius: 10px;
	box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.3),
		inset -2px 2px 4px rgba(255, 255, 255, 0.8),
		inset 2px -2px 4px 1px rgba(0, 0, 0, 0.3);
	z-index: 1;
	border: 3px solid white;
	display: flex;
	align-items: center;
	font-weight: bold;
	color: white;
	font-size: 23px;
}

a.help-audio-btn { color: #1e5f9e; cursor: pointer; }
a.help-audio-btn:hover { color: #043b71; }
a.help-audio-btn::before {
	content: "";
	display: inline-block;
	width: 25px;
	height: 25px;
	margin-right: 2px;
	background-size: cover;
	background-image: url('/resources/audio.png');
	position: relative;
	top: 4px;
	opacity: .7;
}
a.help-audio-btn:hover::before { opacity: 1; }

@media (max-width: 768px) {
	.quiz-container {
		flex-direction: column;
	}

	.control-panel {
		width: 100%;
		border-radius: 20px 20px 0 0;
		max-height: 60vh;
		overflow-y: auto;
	}

	.question-panel {
		padding: 20px;
	}

	.question-panel h2 {
		font-size: 20px;
		padding: 15px 20px;
	}

	.question-panel p {
		font-size: 16px;
		padding: 0 20px 15px 20px;
	}

	.questions-panel { padding: 20px; }

	.questions-panel h2 {
		font-size: 24px;
		margin-bottom: 20px;
	}

	.questions-list a {
		padding: 15px 18px;
		font-size: 15px;
		border-left-width: 5px;
	}

	.questions-list a:hover {
		transform: translateX(5px);
	}
}

/*
@media (max-width: 1400px) {
	#scaler {
		width: 1400px;
		height: 925px;
		transform-origin: top left;
	}
	.quiz-container {
		height: auto;
	}
}
*/

.action-btn.is-loading {
  position: relative;          /* для позиционирования спиннера */
  pointer-events: none;        /* отключаем клики */
  opacity: 0.7;                /* лёгкое затемнение (можно убрать) */
}

/* Сам спиннер */
.action-btn.is-loading::after {
	content: '';
	position: absolute;
	top: 6px;
	right: 6px;
	width: 20px;
	height: 20px;
	border: 3px solid rgba(255, 255, 255, 0.3);   /* полупрозрачный обод */
	border-top-color: #ffffff;                    /* белая верхняя часть */
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

/* Анимация вращения */
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

div#check-question-warning {
	display: none;
	border-radius: 8px;
	border: 1px solid transparent;
	font-size: 20px;
	line-height: 1.45;
	flex: none;
}
div#check-question-warning::before {
	font-size: 20px;
	line-height: 1.45;
	margin-right: 10px;
}
div#check-question-warning.is-uncertain {
	padding: 12px 16px;
	background: #f9ecc2;
	border-color: #dfae1a;
	color: #775c0c;
}
div#check-question-warning.is-uncertain::before {
	content: '⚠️';
}
div#check-question-warning.is-mismatch {
	padding: 12px 16px;
	background: #ffd0d4;
	border-color: #e75463;
	color: #842029;
}
div#check-question-warning.is-mismatch::before {
	content: '❌';
}

/* Базовая плавающая кнопка */
.help-btn {
	position: fixed;
	bottom: 30px;
	left: 30px;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #d27e12;
	color: white;
	border: none;
	font-size: 40px;
	font-weight: bold;
	line-height: 1;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	z-index: 10;
	/* Центрируем знак вопроса */
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Эффект при наведении (даже при мигании) */
.help-btn:hover {
	transform: scale(1.08);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Активное нажатие */
.help-btn:active {
	transform: scale(0.95);
}

/* ----- МИГАНИЕ (пульсация) ----- */
.help-btn.is-blinking {
	animation: helppulse 1.5s ease-in-out infinite;
}

@keyframes helppulse {
	0%, 100% {
		transform: scale(1);
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	}
	50% {
		transform: scale(1.12);
		box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
	}
}

@keyframes helppulselight {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.6; }
}