/* ================================
   HOME PAGE — Full Window Orbit
   ================================ */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;800&display=swap');

html,
body {
	margin: 0;
	padding: 0;
	width: 100vw;
	height: 100vh;
	overflow: hidden !important;
	position: fixed;
	inset: 0;
}

.home-body {
	background: #0b0c0e;
}

.home-wrapper {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

/* Deep space grain/fog overlay */
.space-fog-overlay {
	position: fixed;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
	opacity: 0.12; /* Subtle grain */
	mix-blend-mode: color-dodge;
	mask-image: radial-gradient(circle at center, transparent 30%, black 100%);
}

/* Deep space background */
.home-body::before {
	content: '';
	position: fixed;
	inset: 0;
	background:
		radial-gradient(ellipse 70% 55% at 50% 55%, rgba(60, 20, 160, 0.22) 0%, transparent 70%),
		radial-gradient(ellipse 40% 30% at 15% 85%, rgba(100, 40, 200, 0.12) 0%, transparent 60%),
		radial-gradient(ellipse 35% 25% at 85% 15%, rgba(140, 100, 240, 0.08) 0%, transparent 50%);
	pointer-events: none;
	z-index: 0;
}

.home-wrapper>header {
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 100%;
	max-width: 1000px;
	z-index: 100;
	padding: 40px 24px;
	pointer-events: none;
	animation: none !important; /* Disable style.css fadeIn which breaks translateX centering */
}

.home-wrapper>header a,
.home-wrapper>header nav {
	pointer-events: auto;
}

.home-body .footer {
	display: none !important;
}

/* ================================
   ORBIT MAIN — fills remaining space
   ================================ */
.orbit-main {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
	overflow: hidden;
}

/* Canvas covers full orbit-main area */
#orbitCanvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 1;
}

/* ================================
   SIDE INFO PANELS
   ================================ */
.server-info-panel {
	position: absolute;
	bottom: 90px;
	width: 290px;
	opacity: 0;
	transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
		transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
	z-index: 50;
}

.panel-left {
	left: 20px;
	transform: translateX(-20px);
}

.panel-right {
	right: 20px;
	transform: translateX(20px);
}

.server-info-panel.visible {
	opacity: 1;
	pointer-events: auto;
}

.server-info-panel.visible.panel-left {
	transform: translateX(0);
}

.server-info-panel.visible.panel-right {
	transform: translateX(0);
}

.panel-content {
	background: rgba(14, 16, 22, 0.82);
	border: 1px solid rgba(167, 139, 250, 0.25);
	border-radius: 18px;
	padding: 26px 22px;
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	box-shadow:
		0 0 40px rgba(90, 40, 200, 0.12),
		inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panel-tag {
	font-size: 10px;
	font-weight: 800;
	background: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	text-transform: uppercase;
	letter-spacing: 2.5px;
	margin-bottom: 8px;
}

.panel-section-label {
	font-size: 9px;
	font-weight: 800;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 2.5px;
	margin-bottom: 12px;
	opacity: 0.5;
}

.panel-title {
	font-size: 19px;
	font-weight: 800;
	color: #fff;
	line-height: 1.2;
	margin-bottom: 10px;
	letter-spacing: -0.3px;
}

.panel-desc {
	font-size: 13px;
	color: var(--muted);
	line-height: 1.65;
	margin-bottom: 14px;
}

.panel-stats {
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.panel-stat {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12.5px;
	color: rgba(255, 255, 255, 0.55);
}

.panel-stat-dot {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: #a78bfa;
	box-shadow: 0 0 8px #a78bfa;
	flex-shrink: 0;
}

.panel-features {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 9px;
	margin-bottom: 14px;
}

.panel-features li {
	font-size: 13px;
	color: rgba(255, 255, 255, 0.6);
	padding-left: 14px;
	position: relative;
	line-height: 1.45;
}

.panel-features li::before {
	content: '◆';
	position: absolute;
	left: 0;
	color: #a78bfa;
	font-size: 7px;
	top: 4.5px;
}

.panel-version {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	background: rgba(167, 139, 250, 0.12);
	border: 1px solid rgba(167, 139, 250, 0.35);
	border-radius: 100px;
	font-size: 10px;
	font-weight: 700;
	color: #c4b5fd;
	letter-spacing: 0.5px;
}

/* ================================
   ORBIT SCENE (absolute overlay)
   ================================ */
.orbit-scene {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	pointer-events: none;
}

/* ================================
   CENTER — elegant diamond/gem core
   ================================ */
.orbit-center {
	position: absolute;
	z-index: 15;
	pointer-events: none;
	/* top/left set dynamically by JS */
}

/* Blinding Sun Halo behind the sphere */
.sun-halo {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 200px;
	height: 200px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(253,224,71,0.15) 20%, rgba(234,88,12,0.05) 50%, transparent 80%);
	transform: translate(-50%, -50%);
	pointer-events: none;
	animation: haloPulse 3s ease-in-out infinite alternate;
	mix-blend-mode: screen;
}

@keyframes haloPulse {
	0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.8; }
	100% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

/* ================================
   3D DYSON SPHERE CORE
   ================================ */
.dyson-core {
	position: relative;
	width: 68px;
	height: 68px;
	perspective: 1000px;
	transform-style: preserve-3d;
	display: flex;
	align-items: center;
	justify-content: center;
}

.star-core {
	position: absolute;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #ffffff; /* Pure blinding white */
	box-shadow: 
		0 0 20px #ffffff,
		0 0 45px #fef08a,
		0 0 90px #f59e0b,
		0 0 160px #ea580c;
	animation: starPulse 2.5s ease-in-out infinite alternate;
	z-index: 10;
	transform: translateZ(0); /* Anchor it at Z=0 for correct 3D intersection */
}

@keyframes starPulse {
	0% { transform: scale(0.9); box-shadow: 0 0 15px #fff, 0 0 35px #fef08a, 0 0 70px #f59e0b, 0 0 120px #ea580c; opacity: 0.95; }
	100% { transform: scale(1.1); box-shadow: 0 0 25px #fff, 0 0 50px #fcd34d, 0 0 100px #f59e0b, 0 0 180px #ea580c; filter: brightness(1.2); }
}

.dyson-rings {
	position: absolute;
	width: 100%;
	height: 100%;
	transform-style: preserve-3d;
	animation: dysonSpin 15s infinite linear;
}

@keyframes dysonSpin {
	0% { transform: rotateX(25deg) rotateY(0deg) rotateZ(10deg); }
	100% { transform: rotateX(25deg) rotateY(360deg) rotateZ(10deg); }
}

.d-ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2.2px solid #050505; /* Precise black metal silhouettes */
	box-sizing: border-box;
	box-shadow: 
		inset 0 0 5px rgba(255, 255, 255, 0.6), /* Inner glare */
		0 0 5px rgba(255, 255, 255, 0.4);        /* Outer glare */
}

/* Creating the sphere from intersecting planes */
.ring-eq { transform: rotateX(90deg); border-width: 3.5px; border-color: #000; }
.ring-v1 { transform: rotateY(0deg); }
.ring-v2 { transform: rotateY(60deg); }
.ring-v3 { transform: rotateY(120deg); }

/* ================================
   ORBIT NODES
   ================================ */
.orbit-node {
	position: absolute;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	z-index: 20;
	pointer-events: auto;
	/* JS handles translate */
}

.orbit-node:hover .node-icon {
	border-color: rgba(255, 255, 255, 0.9);
	box-shadow:
		0 0 22px rgba(255, 255, 255, 0.6),
		0 0 45px rgba(255, 255, 255, 0.3),
		0 0 10px rgba(255, 255, 255, 0.2);
	transform: translateY(-4px) scale(1.25);
}

.orbit-node:hover .node-label {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.25);
	transform: translateY(-2px) scale(1.1);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.orbit-node.active .node-icon {
	border-color: var(--accent);
	box-shadow:
		0 0 25px rgba(167, 139, 250, 0.7),
		0 0 50px rgba(167, 139, 250, 0.3);
}

.node-icon {
	width: 58px;
	height: 58px;
	border-radius: 14px;
	border: 2px solid rgba(167, 139, 250, 0.25);
	overflow: hidden;
	background: rgba(14, 16, 22, 0.95);
	transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow:
		0 6px 24px rgba(0, 0, 0, 0.6),
		0 0 12px rgba(100, 60, 220, 0.18),
		inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.node-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

.node-label {
	font-size: 8px;
	font-weight: 800;
	color: rgba(255, 255, 255, 0.65);
	text-transform: uppercase;
	letter-spacing: 1px;
	text-align: center;
	white-space: nowrap;
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
	background: rgba(0, 0, 0, 0.55);
	padding: 3px 8px;
	border-radius: 20px;
	backdrop-filter: blur(6px);
	border: 1px solid rgba(255, 255, 255, 0.05);
	transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================
   START GAME BUTTON
   ================================ */
.start-btn-wrapper {
	position: absolute;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 30;
	pointer-events: auto;
}

.start-game-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 50px;
	text-decoration: none;
	position: relative;
	opacity: 0;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	transform-origin: center center;
}

/* Disable transitions during heavy animations to prevent interference */
.start-game-btn.assembling,
.start-game-btn.disintegrating {
	transition: none !important;
}

/* Ensure visibility after assembly or by default if not assembling */
.start-game-btn:not(.assembling):not(.disintegrating) {
	opacity: 1;
}

.btn-bg-layer {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(76, 29, 149, 0.45) 0%, rgba(139, 92, 246, 0.35) 50%, rgba(76, 29, 149, 0.45) 100%);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(167, 139, 250, 0.25);
	filter: url(#distressed-edge);
	box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
	z-index: 1;
}

.btn-text {
	position: relative;
	z-index: 2;
	font-size: 13.5px;
	font-weight: 800;
	color: #fff;
	letter-spacing: 2.5px;
	text-transform: uppercase;
	text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.start-game-btn.disintegrating {
	pointer-events: none;
	filter: url(#crumble-filter) !important;
	animation: fallingFragments 0.9s ease-in forwards;
}

/* ASSEMBLY ANIMATION (Upon Load) */
.start-game-btn.assembling {
	pointer-events: none;
	filter: url(#assemble-filter) !important;
	animation: assemblingFragments 1.2s cubic-bezier(0.2, 0, 0.2, 1) forwards;
}

@keyframes assemblingFragments {
	0% { 
		transform: scale(6) rotate(-45deg); 
		opacity: 0; 
	}
	40% {
		opacity: 0.4;
	}
	100% { 
		transform: scale(1) rotate(0deg); 
		opacity: 1; 
	}
}

@keyframes fallingFragments {
	0% { transform: scale(1) rotate(0deg); opacity: 1; }
	100% { transform: scale(4.5) rotate(20deg); opacity: 0; }
}

.start-game-btn:hover {
	transform: translateY(-4px) scale(1.05);
}

.start-game-btn:hover .btn-bg-layer {
	background: linear-gradient(135deg, rgba(109, 40, 217, 0.6) 0%, rgba(167, 139, 250, 0.4) 50%, rgba(109, 40, 217, 0.6) 100%);
	box-shadow: 0 0 45px rgba(139, 92, 246, 0.5);
}

.start-game-btn:active {
	transform: translateY(-1px) scale(0.98);
}

@keyframes btnGradientShift {
	0%, 100% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 900px) {
	.server-info-panel {
		display: none;
	}
}

@media (max-width: 600px) {
	.home-body {
		overflow-y: auto;
		height: auto;
	}
}