/* main.css - Base styles and shared utility classes */
* {
	font-family: 'Hammersmith One';
	font-size: 12px;
	-webkit-touch-callout: none;
	user-select: none;
}

html,
body {
	background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
	position: relative;
	overflow: hidden;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
}

.nodisplay {
	display: none !important;
}

::-webkit-input-placeholder {
	color: #cecece;
}

:-moz-placeholder {
	color: #cecece;
	opacity: 1;
}

::-moz-placeholder {
	color: #cecece;
	opacity: 1;
}

:-ms-input-placeholder {
	color: #cecece;
}

input[type=text] {
	-webkit-touch-callout: text;
	user-select: text;
}

.menuLink {
	font-size: 20px;
}

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

a:active, a:hover {
	color: #795094;
}

a:visited {
	color: #a56dc8;
}

span {
	font-size: inherit;
}

:root {
	--menu-card-width: 360px;
}

/* Common Card Styles */
.menuCard {
	text-align: left;
	white-space: normal;
	word-wrap: break-word;
	margin: 0;
	display: block;
	padding: 20px;
	background: #ffffff;
	backdrop-filter: blur(10px);
	border: 2px solid #e0e0e0;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	border-radius: 12px;
	overflow: hidden;
	box-sizing: border-box;
	transition: all 0.3s ease;
}

.menuCard::-webkit-scrollbar {
	width: 6px;
}

.menuCard::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 3px;
}

.menuCard::-webkit-scrollbar-thumb {
	background: #7ee559;
	border-radius: 3px;
}

.menuCard::-webkit-scrollbar-thumb:hover {
	background: #6fc94e;
}

.sectionTitle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    color: #292929;
}

/* Shared Buttons */
.menuButton {
	text-align: center;
	font-size: 18px;
	padding: 14px 20px;
	box-sizing: border-box;
	color: #fff;
	background-color: #7ee559;
	width: 100%;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	font-weight: 600;
	border: none;
	box-shadow: 0 4px 0 #5fb03d;
}

.menuButton:hover {
	background-color: #6fc94e;
	transform: translateY(-2px);
	box-shadow: 0 6px 0 #5fb03d;
}

.menuButton:active {
	transform: translateY(2px);
	box-shadow: 0 2px 0 #5fb03d;
}

.primaryButton {
	background: linear-gradient(to bottom, #7ee559, #6fc94e);
}

.secondaryButton {
	background: linear-gradient(to bottom, #6eb3ef, #5c96c9);
	box-shadow: 0 4px 0 #4a7ba7;
}

/* Shared Settings UI */
.settingsGrid {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.settingItem {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px;
	background: #f5f5f5;
	border-radius: 8px;
	transition: all 0.2s ease;
	border: 1px solid #e0e0e0;
}

.settingItem:hover {
	background: #e8f5e0;
	border-color: rgba(126, 229, 89, 0.4);
	transform: translateX(2px);
}

.settingLabel {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 15px;
	color: #333;
}

.settingLabel i {
	font-size: 25px;
	color: #7ee559;
}

.settingCheckbox {
	appearance: none;
	-webkit-appearance: none;
	width: 44px;
	height: 24px;
	background: #e0e0e0;
	border-radius: 12px;
	position: relative;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	border: 2px solid #d0d0d0;
	outline: none;
}

.settingCheckbox:checked {
	background: #7ee559;
	border-color: #6fc94e;
}

.settingCheckbox::before {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	top: 2px;
	left: 2px;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.settingCheckbox:checked::before {
	transform: translateX(20px);
}

/* Keybinds */
.keybindGrid {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.keybindRow {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	background: #f5f5f5;
	border-radius: 8px;
	font-size: 14px;
	color: #333;
	border: 1px solid #e0e0e0;
}

.keybindKey {
	display: inline-block;
	min-width: 32px;
	padding: 4px 10px;
	text-align: center;
	background: #fff;
	border: 2px solid #ccc;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 700;
	color: #333;
	cursor: pointer;
}

.keybindKey.listening {
	border-color: #4a90d9;
	background: #e8f0fe;
	color: #4a90d9;
	animation: keybindPulse 1s infinite;
}

@keyframes keybindPulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.6; }
}

.keybindResetBtn {
	margin-top: 8px;
	padding: 8px 16px;
	text-align: center;
	background: #f5f5f5;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	color: #666;
	cursor: pointer;
	transition: all 0.2s ease;
}

.keybindResetBtn:hover {
	background: #ffebee;
	border-color: #e53935;
	color: #e53935;
}

/* Resource Displays */
.uiElement,
.resourceDisplay {
	background-color: rgba(0, 0, 0, 0.25);
	border-radius: 4px;
	color: #fff;
	padding: 10px;
	padding-top: 5px;
	padding-bottom: 5px;
	font-size: 28px;
}

.resourceDisplay {
	position: absolute;
	right: 20px;
	height: 35px;
	text-align: right;
	line-height: 39px;
	padding-left: 10px;
	padding-right: 40px;
	background-size: 28px;
	background-repeat: no-repeat;
	background-position: right 6px center;
}

/* Game Canvas */
#gameCanvas {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: #768e5b;
	z-index: 1;
}

/* Common UI Elements */
.gameButton {
	position: absolute;
	top: 20px;
	padding: 5px;
	cursor: pointer;
	pointer-events: all;
}

.gameButton:hover {
	background-color: rgba(50, 50, 50, 0.25);
}

.actionBarItem {
	width: 66px;
	height: 66px;
	margin-left: 5px;
	margin-right: 5px;
	background-color: rgba(0, 0, 0, 0.25);
	border-radius: 4px;
	display: inline-block;
	cursor: pointer;
	pointer-events: all;
	background-size: cover;
}

#errorNotification {
	position: absolute;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	max-width: 500px;
	z-index: 99999;
}

.errorNotificationCenter {
    text-align: center;
}

.errorNotificationHide {
    cursor: pointer;
}

#shutdownDisplay {
	position: absolute;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	color: white;
	font-size: 25px;
	z-index: 100;
	pointer-events: none;
}

/* Mobile Adjustments */
@media only screen and (max-width: 896px) {
	:root {
		--menu-card-width: 350px;
	}

	.uiElement,
	.resourceDisplay {
		font-size: 20px;
	}

	.gameButton {
		bottom: 8px;
		width: 44px;
		height: 44px;
		padding: 0 !important;
	}

	.gameButton i {
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
		font-size: 34px !important;
	}
}

/* Touch Controls */
#touch-controls-left,
#touch-controls-right,
#touch-controls-fullscreen {
	position: absolute;
	width: 50%;
	height: 100%;
	top: 0;
	bottom: 0;
	display: none;
}

#touch-controls-fullscreen {
	width: 100%;
}

#touch-controls-right {
	left: 50%;
}
