body {
	margin: 0px;
	padding: 0px;
	overflow: hidden;
}
canvas {
	display: block;
	/* fix necessary to remove space at bottom of canvas */

	vertical-align: top;
}
#stats {
	position: absolute;
	top: 0;
	left: 0;
}
#about {
	color: #fff;
	position: absolute;
	bottom: 5px;
	left: 5px;
	font-style: italic;
}
a, a:visited {
	color: #fff;
	text-decoration: none;
}
/* loading animation */

#loading {
	width: 100%;
	height: 100%;
	background: #111;
	position: absolute;
	z-index: 10;
}
.spinner {
	width: 50px;
	height: 30px;
	text-align: center;
	font-size: 10px;
	position: absolute;
	top: 50%;
	left: 50%;
	margin-left: -25px;
	margin-top: -15px;
}
.spinner > div {
	background-color: #fff;
	height: 100%;
	width: 6px;
	display: inline-block;
	-webkit-animation: stretchdelay 1.2s infinite ease-in-out;
	animation: stretchdelay 1.2s infinite ease-in-out;
}
.spinner .rect2 {
	-webkit-animation-delay: -1.1s;
	animation-delay: -1.1s;
}
.spinner .rect3 {
	-webkit-animation-delay: -1.0s;
	animation-delay: -1.0s;
}
.spinner .rect4 {
	-webkit-animation-delay: -0.9s;
	animation-delay: -0.9s;
}
.spinner .rect5 {
	-webkit-animation-delay: -0.8s;
	animation-delay: -0.8s;
}
@-webkit-keyframes stretchdelay {
	0%, 40%, 100% {
		-webkit-transform: scaleY(0.4)
	}
	20% {
		-webkit-transform: scaleY(1.0)
	}
}
@keyframes stretchdelay {
	0%, 40%, 100% {
		transform: scaleY(0.4);
		-webkit-transform: scaleY(0.4);
	}
	20% {
		transform: scaleY(1.0);
		-webkit-transform: scaleY(1.0);
	}
}

/* Chat Button - Static Noise Effect */
.static {
	position: fixed;
	bottom: 100px;
	left: 30px;
	z-index: 100;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 20px;
	background: rgba(0, 0, 0, 0.85);
	border: 2px solid #00ffff;
	border-radius: 8px;
	color: #00ffff;
	text-decoration: none;
	font-family: 'Courier New', monospace;
	font-size: 14px;
	font-weight: bold;
	letter-spacing: 2px;
	text-transform: uppercase;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 
		0 0 20px rgba(0, 255, 255, 0.3),
		inset 0 0 15px rgba(0, 255, 255, 0.1);
	overflow: hidden;
}

.static.secondary {
	bottom: 30px;
	border-color: #ff4400;
	color: #ff4400;
	box-shadow: 
		0 0 20px rgba(255, 68, 0, 0.3),
		inset 0 0 15px rgba(255, 68, 0, 0.1);
}

.static.secondary:hover {
	background: rgba(255, 68, 0, 0.15);
	box-shadow: 
		0 0 30px rgba(255, 68, 0, 0.5),
		0 0 60px rgba(255, 68, 0, 0.3),
		inset 0 0 20px rgba(255, 68, 0, 0.2);
	text-shadow: 0 0 10px #ff4400;
}

.static::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: repeating-linear-gradient(
		0deg,
		transparent,
		transparent 2px,
		rgba(0, 255, 255, 0.03) 2px,
		rgba(0, 255, 255, 0.03) 4px
	);
	pointer-events: none;
	animation: staticNoise 0.1s infinite;
}

.static::after {
	content: '';
	position: absolute;
	top: -100%;
	left: -100%;
	width: 300%;
	height: 300%;
	background: linear-gradient(
		45deg,
		transparent 30%,
		rgba(0, 255, 255, 0.1) 50%,
		transparent 70%
	);
	animation: staticSweep 3s ease-in-out infinite;
}

@keyframes staticNoise {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.95; }
}

@keyframes staticSweep {
	0% { transform: translateX(-50%) translateY(-50%) rotate(0deg); }
	100% { transform: translateX(50%) translateY(50%) rotate(0deg); }
}

.static:hover {
	background: rgba(0, 255, 255, 0.15);
	border-color: #00ffff;
	box-shadow: 
		0 0 30px rgba(0, 255, 255, 0.5),
		0 0 60px rgba(0, 255, 255, 0.3),
		inset 0 0 20px rgba(0, 255, 255, 0.2);
	transform: translateY(-3px);
	text-shadow: 0 0 10px #00ffff;
}

.static:active {
	transform: translateY(0);
}

.static svg {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	filter: drop-shadow(0 0 5px rgba(0, 255, 255, 0.5));
	animation: chatPulse 2s ease-in-out infinite;
	position: relative;
	z-index: 1;
}

@keyframes chatPulse {
	0%, 100% {
		filter: drop-shadow(0 0 5px rgba(0, 255, 255, 0.5));
	}
	50% {
		filter: drop-shadow(0 0 12px rgba(0, 255, 255, 0.8));
	}
}

.static .chat-text {
	position: relative;
	z-index: 1;
}

/* Responsive */
@media (max-width: 768px) {
	.static {
		padding: 12px 16px;
		font-size: 12px;
		bottom: 20px;
		left: 20px;
	}
	
	.static svg {
		width: 20px;
		height: 20px;
	}
}

@media (max-width: 480px) {
	.static {
		padding: 12px;
		border-radius: 50%;
	}
	
	.static .chat-text {
		display: none;
	}
}

/* ========== BRAIN CHAT MODAL ========== */
.brain-chat-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(5px);
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
}

.brain-chat-modal.active {
	opacity: 1;
	visibility: visible;
}

.brain-chat-container {
	width: 90%;
	max-width: 450px;
	height: 70vh;
	max-height: 600px;
	background: rgba(10, 15, 25, 0.95);
	border: 2px solid #00ffff;
	border-radius: 16px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 
		0 0 40px rgba(0, 255, 255, 0.3),
		0 0 80px rgba(0, 255, 255, 0.1),
		inset 0 0 30px rgba(0, 255, 255, 0.05);
	transform: scale(0.9) translateY(20px);
	transition: transform 0.3s ease;
}

.brain-chat-modal.active .brain-chat-container {
	transform: scale(1) translateY(0);
}

/* Header */
.brain-chat-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 20px;
	background: rgba(0, 255, 255, 0.1);
	border-bottom: 1px solid rgba(0, 255, 255, 0.3);
}

.brain-avatar {
	width: 48px;
	height: 48px;
	background: linear-gradient(135deg, #00ffff 0%, #0099ff 100%);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: brainPulse 2s ease-in-out infinite;
}

.brain-avatar svg {
	color: #0a0f19;
}

@keyframes brainPulse {
	0%, 100% {
		box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
	}
	50% {
		box-shadow: 0 0 25px rgba(0, 255, 255, 0.8), 0 0 50px rgba(0, 255, 255, 0.4);
	}
}

.brain-info h3 {
	margin: 0;
	color: #00ffff;
	font-family: 'Courier New', monospace;
	font-size: 16px;
	text-transform: uppercase;
	letter-spacing: 2px;
}

.brain-status {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #0099ff;
	font-size: 12px;
	font-family: 'Courier New', monospace;
}

.pulse-dot {
	width: 8px;
	height: 8px;
	background: #00ff88;
	border-radius: 50%;
	animation: pulseDot 1s ease-in-out infinite;
}

@keyframes pulseDot {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.5; transform: scale(0.8); }
}

.brain-chat-close {
	margin-left: auto;
	width: 36px;
	height: 36px;
	background: transparent;
	border: 1px solid rgba(255, 68, 0, 0.5);
	border-radius: 50%;
	color: #ff4400;
	font-size: 24px;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.brain-chat-close:hover {
	background: rgba(255, 68, 0, 0.2);
	border-color: #ff4400;
	box-shadow: 0 0 15px rgba(255, 68, 0, 0.5);
}

/* Messages */
.brain-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.brain-chat-messages::-webkit-scrollbar {
	width: 6px;
}

.brain-chat-messages::-webkit-scrollbar-track {
	background: rgba(0, 255, 255, 0.1);
}

.brain-chat-messages::-webkit-scrollbar-thumb {
	background: rgba(0, 255, 255, 0.3);
	border-radius: 3px;
}

.brain-message {
	max-width: 85%;
	animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.brain-message.user {
	align-self: flex-end;
}

.brain-message.bot {
	align-self: flex-start;
}

.brain-message .message-content {
	padding: 12px 16px;
	border-radius: 12px;
	font-family: 'Courier New', monospace;
	font-size: 14px;
	line-height: 1.5;
}

.brain-message.user .message-content {
	background: rgba(0, 153, 255, 0.3);
	border: 1px solid rgba(0, 153, 255, 0.5);
	color: #ffffff;
	border-bottom-right-radius: 4px;
}

.brain-message.bot .message-content {
	background: rgba(0, 255, 255, 0.1);
	border: 1px solid rgba(0, 255, 255, 0.3);
	color: #00ffff;
	border-bottom-left-radius: 4px;
}

/* Neural text effect */
.neural-text {
	position: relative;
}

.neural-text .neural-glow {
	color: #ffffff;
	text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
	animation: glowFade 0.5s ease forwards;
}

@keyframes glowFade {
	from {
		color: #ffffff;
		text-shadow: 0 0 15px #00ffff, 0 0 30px #00ffff;
	}
	to {
		color: #00ffff;
		text-shadow: none;
	}
}

.neural-text.complete {
	animation: textComplete 0.5s ease;
}

@keyframes textComplete {
	0% { text-shadow: 0 0 20px #00ffff; }
	100% { text-shadow: none; }
}

/* Typing indicator */
.typing-indicator {
	display: flex;
	gap: 4px;
	padding: 8px 0;
}

.typing-indicator span {
	width: 8px;
	height: 8px;
	background: #00ffff;
	border-radius: 50%;
	animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
	0%, 80%, 100% {
		transform: scale(0.6);
		opacity: 0.5;
	}
	40% {
		transform: scale(1);
		opacity: 1;
	}
}

/* Input */
.brain-chat-input {
	display: flex;
	gap: 10px;
	padding: 16px 20px;
	background: rgba(0, 255, 255, 0.05);
	border-top: 1px solid rgba(0, 255, 255, 0.2);
}

.brain-chat-input input {
	flex: 1;
	background: rgba(0, 0, 0, 0.5);
	border: 1px solid rgba(0, 255, 255, 0.3);
	border-radius: 8px;
	padding: 12px 16px;
	color: #ffffff;
	font-family: 'Courier New', monospace;
	font-size: 14px;
	outline: none;
	transition: all 0.2s ease;
}

.brain-chat-input input::placeholder {
	color: rgba(0, 255, 255, 0.5);
}

.brain-chat-input input:focus {
	border-color: #00ffff;
	box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.brain-chat-input button {
	width: 48px;
	height: 48px;
	background: linear-gradient(135deg, #00ffff 0%, #0099ff 100%);
	border: none;
	border-radius: 8px;
	color: #0a0f19;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
}

.brain-chat-input button:hover {
	transform: scale(1.05);
	box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.brain-chat-input button:active {
	transform: scale(0.95);
}

/* Responsive */
@media (max-width: 480px) {
	.brain-chat-container {
		width: 95%;
		height: 80vh;
		border-radius: 12px;
	}
	
	.brain-chat-header {
		padding: 12px 16px;
	}
	
	.brain-avatar {
		width: 40px;
		height: 40px;
	}
	
	.brain-info h3 {
		font-size: 14px;
	}
	
	.static {
		bottom: 80px;
	}
	
	.static.secondary {
		bottom: 20px;
	}
}
