body {
	margin: 0;
	padding: 0;
	background-color: #000;
	color: #fff;
	font-family: Monospace;
	font-size: 13px;
	line-height: 24px;
	overscroll-behavior: none;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.ui {
	position: fixed;
	inset: 0;
	z-index: 15000;
	pointer-events: none;
}

.ui a,
.ui button,
.ui input,
.ui select,
.ui textarea {
	pointer-events: auto;
}

.loading {
	transition: all .5s ease-in-out;
	position: fixed;
	box-sizing: border-box;
	background: #000;
	width: 100%;
	height: 100%;
	text-align: center;
	z-index: 99999;
	padding-top: 25%;
	font-family: 'Arial', sans-serif;
	font-size: 18px;
	font-weight: 300;
	color: #ffffff;
	text-shadow: 0 2px 4px rgba(0,0,0,0.5);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.loading::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 60px;
	height: 60px;
	border: 3px solid rgba(255,255,255,0.1);
	border-top: 3px solid #ffffff;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-bottom: 20px;
}

@keyframes spin {
	0% { transform: translate(-50%, -50%) rotate(0deg); }
	100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.pause-menu {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 20000;
	overflow: hidden;
	pointer-events: auto;
}

.pause-menu.is-visible {
	display: flex;
}

.pause-menu__panel {
	background: rgba(12, 12, 12, 0.95);
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
	padding: 28px 32px;
	min-width: 260px;
	text-align: center;
}

.pause-menu__title {
	margin: 0 0 18px 0;
	font-size: 20px;
	letter-spacing: 0.2em;
	font-weight: 700;
}

.pause-menu__actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.pause-menu__button {
	background: #1c1c1c;
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.1);
	padding: 10px 14px;
	font-size: 12px;
	letter-spacing: 0.1em;
}

.pause-menu__button:hover {
	background: #2a2a2a;
}

.pause-menu__button--danger {
	border-color: rgba(255, 80, 80, 0.5);
	color: #ff8a8a;
}

a {
	color: #ff0;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

button {
	cursor: pointer;
	text-transform: uppercase;
}

#info {
	position: absolute;
	background: rgba(0,0,0,.5);
	top: 0px;
	left: 0;
	right: 0;
	padding: 10px;
	box-sizing: border-box;
	text-align: center;
	-moz-user-select: none;
	-webkit-user-select: none;
	-ms-user-select: none;
	user-select: none;
	pointer-events: none;
	z-index: 1; /* TODO Solve this in HTML */
}

a, button, input, select {
	pointer-events: auto;
}

.lil-gui {
	z-index: 2 !important; /* TODO Solve this in HTML */
}

@media all and ( max-width: 640px ) {
	.lil-gui.root { 
		right: auto;
		top: auto;
		max-height: 50%;
		max-width: 80%;
		bottom: 0;
		left: 0;
	}
}

#overlay {
	position: absolute;
	font-size: 16px;
	z-index: 2;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	background: rgba(0,0,0,0.7);
}

	#overlay button {
		background: transparent;
		border: 0;
		border: 1px solid rgb(255, 255, 255);
		border-radius: 4px;
		color: #ffffff;
		padding: 12px 18px;
		text-transform: uppercase;
		cursor: pointer;
	}

#notSupported {
	width: 50%;
	margin: auto;
	background-color: #f00;
	margin-top: 20px;
	padding: 10px;
}

.position, .rotation {
	font-family: arial;
	display: block;
}

.chat {
	background: rgba(0,0,0,.2);
	text-shadow: 2px 2px 2px #000000;
	color: white;
	position: fixed;
	bottom: 20px;
	left: 20px;
	height: 225px;
	width: 500px;
	padding: 5px;
}

#nickname {
	background: rgba(0,0,0,.2);
	padding: 5px;
	border: none;
	color: white;
	text-shadow: 2px 2px 2px #000000;
	text-transform: none;
	width: 100%;
}

#message-form {
	/* position: absolute;  */
	bottom: 0;
	display: inline-block;
}

#message-list {
	overflow-y: auto;
	display: block;
	height: 150px;
	padding: 5px;
	margin: 5px;
}

#message-list li {
	list-style: none;
}

/* Crosshair: removido de la UI - se generará en Three.js eventualmente */

/* Voicechat */

#voicechat {
	position: relative;
	z-index: 888;
	display: inline-block;
}

canvas#audioVisualizer {
	width: 188px;
	height: 20px;
}
#micButton {
	position: relative;
	bottom: 5px;
	border: none;
	background: none;
	text-shadow: 2px 2px 2px #000000;
	font-size: 20px;
}

#micButton {
	background: rgba(0,0,0,.2);
	padding: 5px;
	border: none;
	color: white;
	text-shadow: 2px 2px 2px #000000;
	text-transform: none;
	width: 100%;
}

/* ✨ NUEVO: Estilos para el panel de información en tiempo real */
.realtime-panel {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(20,20,20,0.8) 100%);
	border-bottom: 1px solid rgba(255,255,255,0.1);
	z-index: 1100; /* Encima del minimapa (1000) */
	pointer-events: none;
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
}

/* Permitir clic en memoria para expandir (exento de pointer lock) */
#realtime-memory-container {
	pointer-events: auto;
	cursor: pointer;
}

.realtime-section {
	padding: 5px 10px;
	max-width: 100%;
	margin: 0 auto;
}

.realtime-title {
	font-size: 10px;
	font-weight: bold;
	color: #00ff88;
	text-align: center;
	margin-bottom: 3px;
	text-shadow: 0 0 5px rgba(0,255,136,0.5);
	letter-spacing: 0.5px;
}

.realtime-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	justify-content: center;
}

.realtime-item {
	display: flex;
	align-items: center;
	padding: 2px 6px;
	background: rgba(255,255,255,0.05);
	border-radius: 3px;
	border-left: 2px solid rgba(0,255,136,0.3);
	transition: all 0.2s ease;
	font-size: 10px;
}

.realtime-item:hover {
	background: rgba(255,255,255,0.1);
	border-left-color: rgba(0,255,136,0.6);
}

.realtime-item .label {
	font-size: 9px;
	color: #cccccc;
	font-weight: 500;
	text-shadow: 0 1px 2px rgba(0,0,0,0.5);
	margin-right: 4px;
}

.realtime-item .value {
	font-size: 9px;
	color: #ffffff;
	font-weight: bold;
	text-shadow: 0 1px 2px rgba(0,0,0,0.5);
	font-family: 'Courier New', monospace;
}

/* Estados especiales */
.realtime-item .value.running {
	color: #ff6b6b;
	text-shadow: 0 0 8px rgba(255,107,107,0.5);
}

.realtime-item .value.melee {
	color: #ffd93d;
	text-shadow: 0 0 8px rgba(255,217,61,0.5);
}

.realtime-item .value.weapon {
	color: #6bcf7f;
	text-shadow: 0 0 8px rgba(107,207,127,0.5);
}

.realtime-item .value.high {
	color: #ff6b6b;
	text-shadow: 0 0 8px rgba(255,107,107,0.5);
}

.realtime-item .value.medium {
	color: #ffd93d;
	text-shadow: 0 0 8px rgba(255,217,61,0.5);
}

.realtime-item .value.low {
	color: #6bcf7f;
	text-shadow: 0 0 8px rgba(107,207,127,0.5);
}

/* Responsive */
@media (max-width: 768px) {
	.realtime-grid {
		grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
		gap: 4px;
	}
	
	.realtime-section {
		padding: 8px 10px;
	}
	
	.realtime-title {
		font-size: 12px;
		margin-bottom: 6px;
	}
	
	.realtime-item {
		padding: 3px 6px;
	}
	
	.realtime-item .label,
	.realtime-item .value {
		font-size: 10px;
	}
}

/* ✨ NUEVO: Panel de visualización de inputs (estilo Street Fighter) */
.input-display {
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 280px;
	max-height: 300px;
	background: linear-gradient(135deg, rgba(0,0,0,0.9) 0%, rgba(20,20,20,0.9) 100%);
	border: 2px solid #4CAF50;
	border-radius: 8px;
	padding: 10px;
	z-index: 1000;
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	overflow-y: auto;
	pointer-events: none;
}

.input-display-title {
	font-size: 12px;
	font-weight: bold;
	color: #4CAF50;
	text-align: center;
	margin-bottom: 8px;
	text-shadow: 0 0 5px rgba(76,175,80,0.5);
	border-bottom: 1px solid rgba(76,175,80,0.3);
	padding-bottom: 5px;
}

.input-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 4px 8px;
	margin: 2px 0;
	border-radius: 4px;
	background: rgba(255,255,255,0.05);
	border-left: 3px solid rgba(255,255,255,0.3);
	transition: all 0.2s ease;
	font-size: 11px;
}

.input-item:hover {
	background: rgba(255,255,255,0.1);
}

.input-item.input-success {
	border-left-color: #4CAF50;
	background: rgba(76,175,80,0.1);
}

.input-item.input-error {
	border-left-color: #f44336;
	background: rgba(244,67,54,0.1);
}

.input-item.input-normal {
	border-left-color: #2196F3;
	background: rgba(33,150,243,0.1);
}

.input-key {
	font-weight: bold;
	color: #ffffff;
	text-shadow: 0 1px 2px rgba(0,0,0,0.5);
	font-family: 'Courier New', monospace;
	min-width: 40px;
}

.input-type {
	color: #cccccc;
	font-size: 10px;
	text-align: center;
	flex: 1;
	margin: 0 8px;
}

.input-time {
	color: #888888;
	font-size: 9px;
	font-family: 'Courier New', monospace;
}

/* Animación de entrada para nuevos inputs */
.input-item {
	animation: inputSlideIn 0.3s ease-out;
}

@keyframes inputSlideIn {
	from {
		opacity: 0;
		transform: translateX(20px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* Fullscreen container for main renderer */
#container {
	position: fixed;
	inset: 0;
	overflow: hidden;
}

#container canvas {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

/* Canvas principal: se marca por JS como .main-canvas para no afectar minimapa/debug */
.main-canvas {
	position: fixed;
	top: 0;
	left: 0;
	margin: 0;
	padding: 0;
	display: block;
	overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
	.input-display {
		width: 240px;
		bottom: 10px;
		right: 10px;
	}
	
	.input-item {
		font-size: 10px;
		padding: 3px 6px;
	}
	
	.input-key {
		min-width: 35px;
	}
	
	.input-time {
		font-size: 8px;
	}
}
