/* Глобальный сброс параметров */
*, *::before, *::after {
	box-sizing: border-box;
}

body { 
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
	margin: 0; 
	padding: 10px; 
	background: #f4f5f7; 
}

/* Основная карточка: фиксированная высота 720px */
.quiz-card { 
	width: 100%;
	max-width: 440px; 
	height: 720px; 
	margin: auto; 
	background: #fff; 
	border-radius: 12px; 
	overflow: hidden; 
	box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
	display: flex; 
	flex-direction: column;
}

/* Шапка со статистикой */
.card-header {
	display: flex; 
	justify-content: space-between; 
	align-items: center;
	padding: 10px 8px; 
	background: #fff; 
	border-bottom: 1px solid #eee;
	color: #555;
	flex-shrink: 0;
}

.stats { 
	display: flex; 
	gap: 5px; 
	font-size: 0.72rem; 
	font-weight: 600;
}

.nav-group { 
	display: flex; 
	gap: 6px; 
}

.correct { color: #28a745; }
.wrong { color: #dc3545; }

.back-btn { 
	display: inline-block;
	background: #fff; 
	border: 1px solid #ddd; 
	padding: 4px 8px; 
	border-radius: 4px; 
	font-size: 0.7rem; 
	font-weight: 600;
	color: #555;
	text-decoration: none;
	text-transform: uppercase;
}

/* Контейнеры изображений: СТРОГО 300px и 380px */
.img-container {
	width: 100%; 
	height: 300px; 
	background: #fff; 
	display: flex; 
	align-items: center; 
	justify-content: center; 
	position: relative;
	flex-shrink: 0;
}

.menu-img {
	height: 380px;
}

.img-container img {
	max-width: 100%; 
	max-height: 100%; 
	object-fit: contain;
	pointer-events: none;
}

.shield { 
	position: absolute; 
	top: 0; left: 0; 
	width: 100%; height: 100%; 
	z-index: 5; 
}

/* Контент и кнопки */
.content { 
	padding: 12px 16px; 
	flex-grow: 1; 
	display: flex;
	flex-direction: column;
}

h2 { 
	font-size: 0.9rem; 
	margin: 0 0 10px 0; 
	color: #333; 
	text-align: center; 
	font-weight: 700;
}

.btn-stack { 
	display: flex; 
	flex-direction: column; 
	gap: 6px; 
}

.quiz-btn {
	width: 100%; 
	padding: 12px; 
	font-size: 0.85rem;
	font-weight: 400; 
	background: #fff; 
	border: 1px solid #e0e0e0; 
	border-radius: 8px;
	cursor: pointer; 
	text-align: center;
	color: #444; 
	transition: background-color 0.1s;
	text-decoration: none;
	display: flex;
	align-items: center;
	justify-content: center;
}

.quiz-btn:active:not(:disabled) { 
	background-color: #007bff; 
	color: #fff; 
	border-color: #007bff; 
}

/* Элементы ответов */
.result-content { text-align: center; }
.feedback-text { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; display: block; }
.painting-info { margin-bottom: 10px; line-height: 1.4; }
.p-author { font-weight: 700; font-size: 1.25rem; color: #222; }
.p-title { font-size: 1.05rem; color: #555; margin: 4px 0; }
.p-year { font-size: 0.9rem; color: #888; }

.wrong-pick {
	font-weight: 600;
	font-size: 0.85rem;
	color: #dc3545;
	margin-bottom: 12px;
	padding: 8px;
	background: #fff5f5; 
	border: 1px solid #feb2b2; 
	border-radius: 6px;
	display: block;
	width: 100%;
}

.next-btn {
	display: block;
	width: 100%;
	padding: 12px;
	background-color: #4dabff;
	color: #fff;
	text-decoration: none;
	border-radius: 8px;
	font-weight: 700;
	text-align: center;
	margin-top: 10px;
}

/* Modal Backdrop */
.modal {
	display: none;
	position: fixed;
	z-index: 1000;
	top: 0; left: 0;
	width: 100%; height: 100%;
	background-color: #000;
	overflow: auto; /* Allows finger scrolling/panning */
	-webkit-overflow-scrolling: touch;
}

/* FIXED UI LAYER: Always stays stuck to the phone glass */
.modal-ui {
	position: fixed;
	top: 0; left: 0;
	width: 100%; height: 100%;
	z-index: 2000;
	pointer-events: none; /* Touches pass through to the image */
}

.close-modal {
	position: absolute;
	top: 15px;
	right: 15px;
	color: #fff;
	font-size: 50px;
	font-weight: bold;
	cursor: pointer;
	pointer-events: auto; /* Button remains clickable */
	text-shadow: 0 0 15px rgba(0,0,0,0.9);
	padding: 10px;
}

/* Image: x1 (Fit) */
.modal-content {
	display: block;
	margin: auto;
	padding: 60px 0;
	width: auto;
	height: auto;
	max-width: 100%; 
	max-height: 100%;
	object-fit: contain;
	cursor: zoom-in;
}

/* Image: xFull (5x / Original Resolution) */
.modal-content.zoomed {
	max-width: none;
	max-height: none;
	cursor: zoom-out;
}

