
/* Global overflow prevention - ensure all elements stay within viewport bounds */
* {
	box-sizing: border-box;
	max-width: 100%;
}

/* Prevent any inline elements from causing horizontal overflow */
img, video, canvas, iframe, embed, object {
	max-width: 100%;
	height: auto;
}

/* Prevent code blocks and pre elements from overflowing */
pre, code {
	overflow-x: auto;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

/* Fix scrollbar issues - prevent double scrollbar on reload */
html {
	/* Let main.css handle the scrollbar settings to avoid conflicts */
	scroll-behavior: smooth;
	max-width: 100vw;
	width: 100%;
}

/* Remove any extra spacing from body */
body {
	/* Let main.css handle the overflow settings to avoid conflicts */
	width: 100%;
	max-width: 100vw;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	min-height: 100vh; /* Ensure full height */
}

/* Fix black space issues - ensure proper spacing */
.center-container {
	min-height: auto; /* Override the calc(100vh - 160px) that creates black space */
	padding: 20px clamp(16px, 6vw, 48px); /* Keep original padding but remove excessive spacing */
	margin: 0 auto;
	justify-content: flex-start; /* Don't center vertically, start from top */
}

/* Ensure navbar doesn't create extra space */
.navbar {
	margin-top: 20px; /* Reduce from 32px */
}

/* Ensure all elements stay within viewport */
* {
	box-sizing: border-box;
}

/* Override the containers.css center alignment */
.center-container .content {
	text-align: left;
}

.section-content h1 {
	text-align: center;
	margin-bottom: 1em;
}

.cheat-section ul, .cheat-section ul ul {
	padding-left: 2em;
	text-align: left;
}

.cheat-section h2 a {
	color: inherit;
	text-decoration: none;
}

.jump-nav {
	text-align: left;
	margin-bottom: 2em;
}

.cheat-section li {
	margin-bottom: 0.7em;
	line-height: 1.7;
	text-align: left;
}

.cheat-section {
	margin-bottom: 2.5em;
}

.note {
	color: var(--embed-text-color);
	opacity: 0.7;
	font-size: 0.9em;
}

code {
	font-size: 1.1em;
	font-weight: 500;
	padding: 4px 8px;
	border-radius: 6px;
	background: var(--codeblock-bg);
	color: var(--codeblock-text-color);
	border: var(--border);
}

/* Source attribution styling */
.source-attribution {
	font-size: 0.98em;
	opacity: 0.7;
}

/* Table styling */
.discord-table {
	width: 100%;
	max-width: 100%;
	border-collapse: collapse;
	margin: 1em 0;
	/* Prevent table from causing horizontal overflow */
	table-layout: fixed;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.discord-table thead tr {
	background: var(--embed-bg);
	border-bottom: 2px solid var(--border);
}

.discord-table th {
	padding: 12px;
	text-align: left;
	border: var(--border);
	/* Ensure table headers break properly */
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.discord-table td {
	padding: 8px 12px;
	border: var(--border);
	/* Ensure table cells break properly */
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.discord-table tbody tr:nth-child(even) {
	background: var(--embed-bg);
}

/* CDN base URL styling */
.cdn-base-url {
	margin-bottom: 1em;
	opacity: 0.8;
}

/* Responsive table wrapper for smaller screens */
@media (max-width: 768px) {
	.discord-table {
		font-size: 0.9em;
	}
	
	.discord-table th,
	.discord-table td {
		padding: 6px 8px;
	}
	
	/* Create horizontal scroll for tables on very small screens if needed */
	.discord-table-wrapper {
		overflow-x: auto;
		margin: 1em 0;
	}
}

#backToTopBtn {
	position: fixed;
	bottom: 32px;
	right: 32px;
	background: var(--embed-bg);
	color: var(--primary-color);
	border: none;
	border-radius: 50%;
	width: 48px;
	height: 48px;
	font-size: 1.5rem;
	display: none;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: var(--shadow-lg);
	z-index: 1000;
	transition: all var(--transition-duration) var(--transition-easing);
}

#backToTopBtn:hover {
	background: var(--primary-color);
	color: var(--embed-bg);
	transform: translateY(-2px);
}
