/**
 * 3D beyin simülasyonu (.sb-brain-sim) — test sonuç modalında kullanılır.
 */

.sb-brain-sim {
	position: relative;
	width: 100%;
	height: 100%;
	min-height: 360px;
	overflow: hidden;
	background: radial-gradient(ellipse at center, #1a1a3e 0%, #0a0a14 70%);
	box-sizing: border-box;
}

.sb-brain-sim *,
.sb-brain-sim *::before,
.sb-brain-sim *::after {
	box-sizing: border-box;
}

.sb-brain-sim__root {
	position: relative;
	width: 100%;
	height: 100%;
	min-height: inherit;
}

.sb-brain-sim__viewport {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.sb-brain-sim__viewport canvas {
	display: block;
	width: 100% !important;
	height: 100% !important;
}

/* Tooltip — glassmorphic */
.sb-brain-sim .brain-tooltip {
	position: fixed;
	pointer-events: none;
	opacity: 0;
	transform: translate(-50%, -120%);
	background: rgba(20, 20, 45, 0.92);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 16px;
	padding: 14px 18px;
	color: #fff;
	min-width: 280px;
	max-width: min(700px, calc(100vw - 24px));
	max-height: min(85dvh, 780px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	z-index: 100003;
	transition:
		opacity 0.2s ease,
		transform 0.2s ease;
	box-shadow:
		0 8px 40px rgba(0, 0, 0, 0.5),
		0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.sb-brain-sim .brain-tooltip.visible {
	opacity: 1;
	transform: translate(-50%, calc(-100% - 16px));
}

.sb-brain-sim .brain-tooltip::after {
	content: "";
	position: absolute;
	bottom: -8px;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
	border-top: 8px solid rgba(20, 20, 45, 0.92);
}

.sb-brain-sim .tooltip-region {
	font-size: 0.55rem;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	opacity: 0.7;
	margin-bottom: 8px;
}

.sb-brain-sim .tooltip-title {
	font-size: 0.92rem;
	font-weight: 700;
	margin-bottom: 4px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.sb-brain-sim .tooltip-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
	box-shadow: 0 0 12px currentColor;
}

.sb-brain-sim .tooltip-divider {
	height: 1px;
	background: rgba(255, 255, 255, 0.12);
	margin: 8px 0;
	flex-shrink: 0;
}

.sb-brain-sim .tooltip-region,
.sb-brain-sim .tooltip-title {
	flex-shrink: 0;
}

.sb-brain-sim .tooltip-desc {
	font-size: 0.76rem;
	opacity: 0.92;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	flex: 0 1 auto;
	min-height: 0;
	/* flex üstünde height:auto iken flex:1 kaydırmayı bozuyor; sabit tavan + kaydır */
	max-height: min(46dvh, calc(100dvh - 200px));
	overflow-y: auto;
	overscroll-behavior: contain;
	pointer-events: auto;
	touch-action: pan-y;
	-webkit-overflow-scrolling: touch;
	scrollbar-gutter: stable;
}

.sb-brain-sim .tooltip-desc::-webkit-scrollbar {
	width: 7px;
}

.sb-brain-sim .tooltip-desc::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.28);
	border-radius: 4px;
}

.sb-brain-sim .tooltip-desc::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.15);
	border-radius: 4px;
}

.sb-brain-sim__hint {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.4);
	font-size: 0.78rem;
	letter-spacing: 0.05em;
	pointer-events: none;
	z-index: 2;
	text-align: center;
	max-width: 90%;
}

@media (max-width: 768px) {
	.sb-brain-sim .brain-tooltip {
		min-width: 200px;
		max-width: min(calc(100vw - 16px), 700px);
		padding: 12px 14px;
		border-radius: 12px;
	}

	.sb-brain-sim .tooltip-title {
		font-size: 0.88rem;
	}

	.sb-brain-sim .tooltip-desc {
		font-size: 0.72rem;
		max-height: min(42dvh, calc(100dvh - 180px));
	}

	.sb-brain-sim__hint {
		bottom: 12px;
		font-size: 0.7rem;
	}
}
