/* Edit button tooltip */
.card-header {
	overflow: visible !important;
}

/* Allow tooltip to render outside the card boundary */
.customizations-section .quiz-card {
	overflow: visible;
}

.edit-btn-tooltip-wrap {
	position: relative;
}

.edit-btn-tooltip {
	position: absolute;
	top: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	background: #333;
	color: #fff;
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 12px;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s;
	z-index: 100;
}

.edit-btn-tooltip::after {
	content: '';
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-bottom-color: #333;
}

.edit-btn-tooltip-wrap:hover .edit-btn-tooltip {
	opacity: 1;
}

/* ── Critical fix: overflow-x:hidden on .main-section creates a new scroll
   context in all major browsers, which silently breaks position:sticky for
   every child element. overflow-x:clip does the same visual clipping but
   does NOT create a scroll container, so sticky works as expected. ──────── */
.main-section {
	overflow-x: clip;
}

/* Keep the open section header visible while scrolling without covering rows */
.accordion-section .quiz-card,
.accordion-section .hm-quiz-card,
.accordion-section .fusion-quiz-card {
	overflow: visible;
}

.accordion-section .card-header {
	position: sticky !important;
	top: 0 !important;
	z-index: 40 !important;
	background: #fafbfc;
	border-radius: 0 !important;
}

.accordion-section .card-header.active {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.accordion-section .card-header + .card-content {
	position: relative;
	z-index: 1;
}

/* Nested card-headers (TicTacToe inner round cards inside .card-content)
   sit below the outer sticky Questions header (~73px) */
.accordion-section .card-content .card-header {
	top: 73px !important;
	z-index: 35 !important;
}

/* List game: round cards must not clip sticky children */
.accordion-section .list-question-card {
	overflow: visible;
}

/* List game round headers — sticky, stacks below the outer Questions header (~73px) */
.accordion-section .list-question-header {
	position: sticky;
	top: 73px;
	z-index: 35;
	background: #f0f9fb;
	border-radius: 10px 10px 0 0;
	padding-bottom: 6px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Grid / TicTac card readability and detail modal */
.grid-game-card,
.mobile-question-item,
.TTTGridBox.TTTboxstyle {
	cursor: pointer;
}

.question-detail-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	z-index: 10050;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.question-detail-modal {
	position: relative;
	width: min(1200px, 96%);
	max-height: 94vh;
	overflow: auto;
	background: #ffffff;
	border-radius: 14px;
	padding: 20px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.question-detail-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.question-detail-title-wrap {
	min-width: 0;
}

.question-detail-title {
	font-size: 23px;
	font-weight: 800;
	line-height: 1.2;
	color: #0f172a;
	margin-bottom: 4px;
}

.question-detail-subtitle {
	font-size: 15px;
	line-height: 1.4;
	color: #64748b;
}

.question-detail-close {
	position: relative;
	margin-left: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 999px;
	background: #f3f4f6;
	color: #111827;
	cursor: pointer;
	font-size: 18px;
	z-index: 2;
}

.question-detail-section {
	padding: 8px 0 4px;
	border-top: 1px solid #e5e7eb;
}

.question-detail-section:first-of-type {
	border-top: 0;
}

.question-detail-label {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #0ea5a5;
	margin-bottom: 8px;
}

.question-detail-text {
	font-size: 21px;
	line-height: 1.5;
	color: #111827;
	white-space: pre-wrap;
	word-break: break-word;
	margin-bottom: 12px;
}

.question-detail-media-group {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 8px;
}

.question-detail-media-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 1px solid #cfd8e3;
	background: #f8fafc;
	color: #1f2937;
	padding: 8px 12px;
	border-radius: 10px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}

.question-detail-media-btn:hover {
	background: #ecfeff;
	border-color: #26d0ce;
}

@media (max-width: 768px) {
	.question-detail-overlay {
		padding: 10px;
	}

	.question-detail-modal {
		max-height: 96vh;
		padding: 14px;
		border-radius: 12px;
	}

	.question-detail-header {
		position: sticky;
		top: 0;
		background: #fff;
		padding-bottom: 8px;
		z-index: 2;
	}

	.question-detail-title {
		font-size: 21px;
	}

	.question-detail-subtitle {
		font-size: 14px;
	}

	.question-detail-text {
		font-size: 18px;
		line-height: 1.6;
	}

	.question-detail-media-btn {
		width: 100%;
		justify-content: center;
	}
}

