@font-face {
	font-family: 'GameFont';
	src: url('../css/fonts/GameFont.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
}

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

html,
body {
	position: relative;
	overflow: hidden;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
}

::-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;
	-webkit-user-select: text;
	-khtml-user-select: text;
	-moz-user-select: text;
	-ms-user-select: text;
	user-select: text;
}

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

a:active {
	color: #795094;
}

a:visited {
	color: #a56dc8;
}

a:hover {
	color: #795094;
}

* {
	font-family: 'GameFont', sans-serif;
	font-size: 12px;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

span {
	font-size: inherit;
}

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

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

.ytLink {
	color: #6eb3ef;
	font-size: 24px;
	text-decoration: none;
}

.ytLink:hover {
	color: #5c96c9;
}

#mainMenu {
	background-color: rgba(0, 0, 0, 0.5);
	position: absolute;
	width: 100%;
	height: 100%;
	z-index: 10;
}

#menuContainer {
	width: 100%;
	white-space: nowrap;
	text-align: center;
	position: absolute;
	top: 45%;
	transform: translateY(-50%);
	-ms-transform: translateY(-50%);
	-moz-transform: translateY(-50%);
	-webkit-transform: translateY(-50%);
	-o-transform: translateY(-50%);
}

#partyButton {
	display: none;
}

#pingDisplay {
	position: absolute;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	color: white;
}

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

#settingsButton {
	position: absolute;
	cursor: pointer;
	display: none;
}

#loadingText {
	font-size: 45px;
	color: #fff;
	text-align: center;
}

#loadingText a {
	display: block;
}

/* Menu Layout */
#menuCardHolder {
	display: inline-flex;
	gap: 8px;
	justify-content: center;
	align-items: flex-start;
	animation: menuFadeIn 0.5s ease-out;
	white-space: normal;
	padding: 0 20px;
}

@keyframes menuFadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes slideInLeft {
	from {
		opacity: 0;
		transform: translateX(-30px);
	}

	to {
		opacity: 1;
		transform: translateX(0);
	}
}

@keyframes slideInCenter {
	from {
		opacity: 0;
		transform: translateY(30px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes slideInRight {
	from {
		opacity: 0;
		transform: translateX(30px);
	}

	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* Card Styles */
.menuCard {
	box-sizing: border-box;
	max-width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
}

/* Tabbed Card */

/* Tab Content */

@keyframes fadeSlideIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.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);
	-webkit-border-radius: 12px;
	-moz-border-radius: 12px;
	border-radius: 12px;
	overflow: hidden;
	box-sizing: border-box;
	transition: all 0.3s ease;
}

#skinColorHolder {
	padding: 8px;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
	gap: 10px;
}

.skinOption {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 100%;
	padding: 8px 6px;
	border-radius: 12px;
	border: 2px solid #d0d0d0;
	background: #fff;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
	transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
	cursor: pointer;
}

.skinOption img,
.skinOption__placeholder {
	width: 52px;
	height: 52px;
	object-fit: contain;
}

.skinOption__placeholder {
	border-radius: 50%;
	background: #f0f0f0;
	border: 2px dashed #d0d0d0;
}

.skinOption span {
	font-size: 13px;
	font-weight: 600;
	color: #3a3a3a;
}

.skinOption:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.activeSkin {
	border-color: var(--accent, #7ee559);
	box-shadow: 0 0 12px rgba(126, 229, 89, 0.65);
}

@keyframes slideUpFadeIn {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(10px) scale(0.9);
	}

	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0) scale(1);
	}
}

@keyframes slideUpFadeOut {
	from {
		opacity: 1;
		transform: translateX(-50%) translateY(0) scale(1);
	}

	to {
		opacity: 0;
		transform: translateX(-50%) translateY(8px) scale(0.92);
	}
}

@keyframes gameLogoFloat {
	0% {
		transform: translateY(-6px);
	}

	50% {
		transform: translateY(6px);
	}

	100% {
		transform: translateY(-6px);
	}
}

#gameName {
	margin-bottom: -25px;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	font-size: 0;
	text-shadow: none;
	color: inherit;
	filter: none;
}

#gameName .gameLogo {
	display: block;
	width: clamp(160px, 30vw, 320px);
	max-width: 100%;
	height: auto;
	filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45));
	animation: gameLogoFloat 2.8s ease-in-out infinite;
}

/* Menu Layout */
#menuCardHolder {
	display: inline-flex;
	gap: 8px;
	justify-content: center;
	align-items: flex-start;
	animation: menuFadeIn 0.5s ease-out;
	white-space: normal;
	padding: 0 20px;
}

@keyframes menuFadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes slideInLeft {
	from {
		opacity: 0;
		transform: translateX(-30px);
	}

	to {
		opacity: 1;
		transform: translateX(0);
	}
}

@keyframes slideInCenter {
	from {
		opacity: 0;
		transform: translateY(30px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes slideInRight {
	from {
		opacity: 0;
		transform: translateX(30px);
	}

	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* Card Styles */
.menuCard {
	box-sizing: border-box;
	max-width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
}

/* Section Titles */
.sectionTitle {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 18px;
	color: #292929;
	margin-bottom: 14px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.sectionTitle i {
	font-size: 22px;
	color: #7ee559;
}

/* Tabbed Card */

/* Tab Content */

@keyframes fadeSlideIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

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

/* Info Box */

/* Account Tab */

#nameInput {
	text-align: center;
	font-size: 18px;
	padding: 14px 16px;
	border: 2px solid #e0e0e0;
	outline: none;
	box-sizing: border-box;
	color: #333;
	background: #fff;
	width: 100%;
	-webkit-border-radius: 8px;
	-moz-border-radius: 8px;
	border-radius: 8px;
	transition: all 0.3s ease;
	font-weight: 500;
}

#nameInput:hover {
	border-color: #c0c0c0;
	background: #f9fff7;
}

#nameInput:focus {
	border-color: #7ee559;
	box-shadow: 0 0 0 3px rgba(126, 229, 89, 0.2);
	background: #fff;
}

#gameUI {
	pointer-events: none;
	z-index: 2;
}

#chatHolder {
	position: absolute;
	bottom: 200px;
	width: 100%;
	text-align: center;
}

#chatBox {
	padding: 6px;
	font-size: 20px;
	color: #fff;
	background-color: rgba(0, 0, 0, 0.25);
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
	pointer-events: all;
	border: 0;
}

#chatBox:focus {
	outline: none;
}

#topInfoHolder {
	position: absolute;
	right: 20px;
	top: 20px;
}

#cornerSettingsHolder {
	position: absolute;
	left: 20px;
	top: 20px;
	pointer-events: all;
}

#cornerSettingsCard {
	width: 220px;
	background-color: rgba(0, 0, 0, 0.25);
	border-radius: 4px;
	padding: 10px;
	color: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

#cornerSettingsTitle {
	margin-bottom: 6px;
}

.cornerSettingsNav {
	display: flex;
	gap: 6px;
	margin-bottom: 8px;
}

.cornerSettingsTab {
	flex: 1 1 0;
	padding: 6px 8px;
	border-radius: 4px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	cursor: pointer;
	font-size: 13px;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.cornerSettingsTab.active {
	background: rgba(255, 255, 255, 0.16);
	border-color: rgba(255, 255, 255, 0.4);
}

.cornerSettingsTab:hover {
	border-color: rgba(255, 255, 255, 0.3);
}

.cornerSettingsContent {
	display: none;
}

.cornerSettingsContent.active {
	display: block;
}

#cornerSettingsTitle {
	font-size: 24px;
	font-weight: 700;
	margin-bottom: 6px;
}

.cornerSettingsList {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.cornerSettingsItem {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 16px;
	cursor: pointer;
}

.cornerSettingsStatValue {
	margin-left: auto;
	font-weight: 700;
}

.cornerSettingsItem input {
	width: 18px;
	height: 18px;
	margin: 0;
}

.cornerSettingsGroup {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 6px;
}

.cornerSettingsLabel {
	font-size: 14px;
	font-weight: 600;
}

.cornerSettingsSelect,
.cornerSettingsInput {
	width: 100%;
	background-color: rgba(0, 0, 0, 0.2);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 4px;
	padding: 6px;
	color: #fff;
	font-size: 14px;
}

.cornerSettingsGrid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin-top: 8px;
}

.cornerSettingsSubLabel {
	display: flex;
	flex-direction: column;
	font-size: 12px;
	gap: 4px;
}

.cornerSettingsButton {
	margin-top: 10px;
	width: 100%;
	padding: 8px 10px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	font-size: 14px;
	border-radius: 4px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.cornerSettingsButton:hover {
	border-color: rgba(255, 255, 255, 0.45);
	background: rgba(255, 255, 255, 0.12);
}

#leaderboard {
	color: #fff;
	font-size: 31px;
	text-align: left;
	padding: 10px;
	padding-top: 7px;
	padding-bottom: 5px;
	width: 220px;
	background-color: rgba(0, 0, 0, 0.25);
	border-radius: 4px;
}

.leaderHolder {
	overflow: hidden;
	white-space: nowrap;
}

#killCounter {
	right: 0px;
	margin-top: 10px;
	color: #fff;
	font-size: 28px;
	background-color: rgba(0, 0, 0, 0.25);
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
	background-image: url(../img/icons/skull.png);
}

.leaderScore {
	text-align: right;
	float: right;
	margin-left: 10px;
	display: inline-block;
	white-space: nowrap;
	overflow: hidden;
	font-size: 22px;
	transition: all 0.2s ease;
}

.leaderboardItem {
	float: left;
	display: inline-block;
	max-width: calc(100% - 90px);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 22px;
	color: #fff;
	font-weight: 400;
}

.uiElement,
.resourceDisplay {
	background-color: rgba(0, 0, 0, 0.25);
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	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;
}

#foodDisplay {
	background-image: url(../img/resources/food_ico.png);
}

#woodDisplay {
	background-image: url(../img/resources/wood_ico.png);
}

#stoneDisplay {
	background-image: url(../img/resources/stone_ico.png);
}

#scoreDisplay {
	right: inherit;
	left: 20px;
	bottom: 160px;
	text-align: left;
	padding-left: 40px;
	padding-right: 10px;
	background-position: left 6px center;
	background-image: url(../img/resources/gold_ico.png);
}

#stoneDisplay {
	bottom: 20px;
}

#woodDisplay {
	bottom: 75px;
}

#foodDisplay {
	bottom: 130px;
}

#actionBar {
	bottom: 17px;
	width: 100%;
	text-align: center;
}

.actionBarItem {
	width: 76px;
	height: 76px;
	margin-left: 2px;
	margin-right: 2px;
	background-color: transparent;
	background-image: url(../ui/inventorySlot.png);
	background-repeat: no-repeat;
	background-position: center;
	background-size: auto, 100% 100%;
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
	display: inline-block;
	cursor: pointer;
	pointer-events: all;
}

.actionBarItem:hover {
	background-color: transparent;
	filter: brightness(1.08);
}

#mapDisplayHolder {
	position: absolute;
	bottom: 20px;
	left: 20px;
	display: inline-block;
	width: 130px;
	height: 130px;
	pointer-events: all;
}

#mapDisplay {
	width: calc(100% - 16px);
	height: calc(100% - 16px);
	margin: 8px;
	display: block;
	background-color: rgba(0, 0, 0, 0.25);
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
}

#mapDisplayHolder::after {
	content: "";
	position: absolute;
	inset: -12px;
	background: url(../ui/mapBorder.png) no-repeat center;
	background-size: 100% 100%;
	pointer-events: none;
}

#performanceDisplay {
	position: absolute;
	bottom: 20px;
	left: 160px;
	width: 120px;
	height: 114px;
	background-color: rgba(0, 0, 0, 0.20);
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
	padding: 8px;
	display: flex;
	flex-direction: column;
	justify-content: space-around;
	pointer-events: none;
	color: #fff;
	font-size: 14px;
}

.performanceItem {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 2px 0;
}

.performanceLabel {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.8);
	font-weight: 500;
}

.performanceValue {
	font-size: 14px;
	color: #ffffff;
}

.gameButton {
	position: absolute;
	top: 20px;
	padding: 5px;
	cursor: pointer;
	pointer-events: all;
}

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

#allianceButton {
	right: 280px;
}

#leaderboardButton {
	display: none;
	-webkit-tap-highlight-color: transparent;
	-webkit-touch-callout: none;
}

#leaderboardButton:focus {
	outline: none !important;
}

#storeButton {
	right: 350px;
}

#gameSettingsButton {
	right: 420px;
}

#allianceButton,
#storeButton,
#gameSettingsButton,
#settingsButton {
	width: 64px;
	height: 64px;
	padding: 0;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 100% 100%;
	background-color: transparent;
}

#allianceButton {
	background-image: url(../ui/allienceButton.png);
}

#storeButton {
	background-image: url(../ui/storeButton.png);
}

#gameSettingsButton,
#settingsButton {
	background-image: url(../ui/settingsButton.png);
}

#allianceButton:hover,
#storeButton:hover,
#gameSettingsButton:hover,
#settingsButton:hover {
	background-color: transparent;
}

#allianceButton i,
#storeButton i,
#gameSettingsButton i,
#settingsButton i {
	display: none;}

#storeMenu {
	display: none;
	width: 100%;
	position: absolute;
	text-align: center;
	top: 50%;
	transform: translateY(-50%);
	-ms-transform: translateY(-50%);
	-moz-transform: translateY(-50%);
	-webkit-transform: translateY(-50%);
	-o-transform: translateY(-50%);
}

#storeHolder {
	pointer-events: all;
	width: 400px;
	display: inline-block;
	background-color: rgba(0, 0, 0, 0.25);
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
	color: #fff;
	padding: 10px;
	height: 200px;
	max-height: calc(100vh - 200px);
	overflow-y: scroll;
	-webkit-overflow-scrolling: touch;
}

#storeHolder.storeNoScroll {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.storeTab {
	width: 183px;
	font-size: 26px;
	display: inline-block;
	background-color: rgba(0, 0, 0, 0.25);
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
	color: #fff;
	padding: 10px;
	pointer-events: all;
	cursor: pointer;
}

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

.storeItem {
	color: #fff;
	padding: 5px;
	font-size: 24px;
	text-align: left;
	cursor: pointer;
}

.itemPrice {
	margin-top: 5px;
	float: right;
	display: inline-block;
	color: rgba(255, 255, 255, 0.5);
	font-size: 24px;
	padding-right: 5px;
}

.hatPreview {
	margin-top: -5px;
	width: 65px;
	height: 65px;
	display: inline-block;
	vertical-align: middle;
	padding-right: 10px;
}

#allianceMenu {
	display: none;
	width: 100%;
	position: absolute;
	text-align: center;
	top: 50%;
	transform: translateY(-50%);
	-ms-transform: translateY(-50%);
	-moz-transform: translateY(-50%);
	-webkit-transform: translateY(-50%);
	-o-transform: translateY(-50%);
}

#allianceHolder {
	pointer-events: all;
	height: 200px;
	max-height: calc(100vh - 260px);
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	width: 350px;
	display: inline-block;
	text-align: left;
	padding: 10px;
	background-color: rgba(0, 0, 0, 0.25);
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
}

.allianceItem {
	font-size: 24px;
	color: #fff;
	padding: 5px;
}

.joinAlBtn {
	float: right;
	font-size: 24px;
	text-align: right;
	cursor: pointer;
	color: #80eefc;
}

.joinAlBtn:hover {
	color: #72d3e0;
}

.notificationText {
	vertical-align: top;
	font-size: 25px;
	color: #fff;
	display: inline-block;
}

.notifButton {
	padding: 5px;
	margin-left: 10px;
	display: inline-block;
	cursor: pointer;
	pointer-events: all;
	background-color: rgba(0, 0, 0, 0.25);
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
}

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

#notificationDisplay {
	vertical-align: top;
	position: absolute;
	right: 270px;
	top: 80px;
	text-align: right;
}

.allianceButtonM {
	pointer-events: all;
	cursor: pointer;
	margin-top: 10px;
	font-size: 24px;
	color: #fff;
	padding: 5px;
	background-color: rgba(0, 0, 0, 0.25);
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
	padding: 5px;
	text-align: center;
	display: inline-block;
}

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

#allianceInput {
	pointer-events: all;
	font-size: 24px;
	color: #fff;
	padding: 5px;
	background-color: rgba(0, 0, 0, 0.25);
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
	padding: 5px;
	display: inline-block;
	outline: none;
	border-color: none;
	border: 0;
	-webkit-box-shadow: none;
	box-shadow: none;
	width: 200px;
	margin-right: 10px;
}

#itemInfoHolder {
	max-width: 250px;
	display: none;
	position: absolute;
	top: 20px;
	left: 20px;
}

#itemInfoHolder.visible {
	display: block;
}

#itemInfoName {
	font-size: 30px;
}

#itemInfoDesc {
	font-size: 22px;
	color: rgba(255, 255, 255, 0.6);
}

.itemInfoReq {
	font-size: 22px;
}

.itemInfoReqVal {
	font-size: 22px;
	color: rgba(255, 255, 255, 0.6);
}

.itemInfoLmt {
	font-size: 22px;
	display: block;
	margin-top: 6px;
	text-align: right;
	color: rgba(255, 255, 255, 0.6);
}

#ageBarContainer {
	width: 100%;
	bottom: 93px;
	text-align: center;
}

#ageText {
	width: 100%;
	bottom: 118px;
	text-align: center;
	color: #fff;
	font-size: 24px;
}

#ageBar {
	background-color: rgba(0, 0, 0, 0.25);
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
	padding: 5px;
	width: 314px;
	height: 10px;
	display: inline-block;
}

#ageBarBody {
	background-color: rgba(255, 255, 255, 1);
	-webkit-border-radius: 3px;
	-moz-border-radius: 3px;
	border-radius: 3px;
	width: 0px;
	height: 100%;
	transition: width 0.3s ease;
}

#upgradeHolder {
	width: 100%;
	position: absolute;
	text-align: center;
	top: 10px;
}

#upgradeCounter {
	width: 100%;
	position: absolute;
	top: 95px;
	text-align: center;
	font-size: 24px;
	color: #fff;
}

#gameCanvas {
	width: 100%;
	height: 100%;
	background-color: #b6db66;
	z-index: 1;
}

#diedText {
	display: none;
	font-size: 150px;
	color: #fff;
	background-color: rgba(0, 0, 0, 0.25);
	width: 100%;
	padding: 0px;
	position: absolute;
	text-align: center;
	top: 50%;
	transform: translateY(-50%);
	-ms-transform: translateY(-50%);
	-moz-transform: translateY(-50%);
	-webkit-transform: translateY(-50%);
	-o-transform: translateY(-50%);
	pointer-events: none;
}

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

	#pingDisplay {
		right: 10px;
		left: auto;
		top: 50px;
		text-align: right;
		transform: none;
	}

	#actionBar {
		max-width: calc(100% - 340px);
		margin-left: 170px;
	}

	/* HOME */
	#guideCard {
		position: absolute;
		display: none;
		z-index: 10;
		top: calc(50% + 20px);
		left: 50%;
		transform: translate(-50%, -50%);
	}

	#guideCard.showing {
		display: flex !important;
		flex-direction: column;
	}

	#loadingText {
		margin-top: 20px;
	}

	#gameName {
		margin-bottom: -5px;
	}

	#gameName .gameLogo {
		width: clamp(150px, 40vw, 260px);
	}

	#menuCardHolder {
		margin-top: 20px;
	}

	#menuCardHolder {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.sectionTitle {
		font-size: 18px;
	}

	.sectionTitle i {
		font-size: 20px;
	}

	#guideCard.showing {
		display: flex !important;
	}

	#partyButton {
		top: 8px;
		left: 33%;
		right: inherit;
		transform: translateX(-50%);
	}

	#settingsButton {
		display: block;
		bottom: 28px;
		left: 50%;
		transform: translateX(-50%);
	}

	/* GAME */
	#mapDisplayHolder {
		width: 66px;
		height: 66px;
		bottom: unset;
		top: 8px;
		left: 8px;
	}

	#performanceDisplay {
		width: 90px;
		height: 66px;
		bottom: unset;
		top: 8px;
		left: 82px;
		padding: 4px;
		font-size: 10px;
	}

	.performanceLabel {
		font-size: 9px;
	}

	.performanceValue {
		font-size: 10px;
	}

	#itemInfoHolder {
		max-width: 128px;
		top: inherit;
		top: 8px;
		right: 8px;
		left: inherit;
	}

	#itemInfoName {
		font-size: 22px;
	}

	#itemInfoDesc,
	#itemInfoDesc,
	.itemInfoReq,
	.itemInfoLmt,
	.itemInfoReqVal {
		font-size: 12px;
	}

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

	.resourceDisplay,
	#scoreDisplay {
		right: inherit;
		left: 8px;
		height: 25px;
		line-height: 27px;

		padding-left: 36px;
		padding-right: 10px;

		background-size: 24px;
		background-position: left 6px center;
	}

	#foodDisplay {
		top: 82px;
		bottom: inherit;
	}

	#woodDisplay {
		top: 124px;
		bottom: inherit;
	}

	#stoneDisplay {
		top: 166px;
		bottom: inherit;
	}

	#scoreDisplay {
		top: 208px;
		left: 8px;
		bottom: inherit;
	}

	#topInfoHolder {
		top: 8px;
		right: 8px;
	}

	#killCounter {
		left: inherit;
		margin-top: 0;
	}

	#actionBar {
		bottom: 8px;
		min-height: 44px;
		max-width: calc(100% - 88px);
		margin-left: 44px;
	}

	.actionBarItem {
		width: 52px;
		height: 52px;
		margin-left: 2px;
		margin-right: 2px;
	}

	#upgradeCounter {
		font-size: 18px;
		top: 58px;
	}

	#ageText {
		bottom: 70px;
		font-size: 16px;
	}

	#ageBarContainer {
		bottom: 54px;
	}

	#ageBar {
		-webkit-border-radius: 6px;
		-moz-border-radius: 6px;
		border-radius: 6px;
		padding: 3px;
		width: 200px;
		height: 6px;
	}

	#ageBarBody {
		-webkit-border-radius: 3px;
		-moz-border-radius: 3px;
		border-radius: 3px;
	}

	#leaderboard {
		display: none;
		width: 340px;
		position: fixed;
		top: 50%;
		left: 50%;
		margin-left: -180px;
		margin-top: -100px
	}

	#leaderboardData,
	.leaderHolder,
	.leaderboardItem,
	.leaderScore {
		font-size: 18px;
	}

	.leaderScore {
		margin-left: 0;
	}

	#notificationDisplay {
		top: inherit;
		right: inherit;
		left: 50%;
		bottom: 96px;
		transform: translateX(-50%);
		text-align: center;
	}

	.notificationText {
		line-height: 35px;
		font-size: 18px;
		display: block;
	}

	.notifButton {
		padding: 3px 3px 0 3px;
		margin-left: 4px;
		margin-right: 4px;
	}

	#allianceButton {
		top: inherit;
		right: 14px;
	}

	#storeButton {
		top: inherit;
		right: 72px;
	}

	#chatButton {
		top: inherit;
		left: 8px;
		display: none;
	}

	#chatButton.hide {
		display: none;
	}

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

	#allianceButton,
	#storeButton,
	#gameSettingsButton,
	#settingsButton {
		width: 58px;
		height: 58px;
	}

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

	.allianceItem,
	#allianceInput,
	.allianceButtonM {
		font-size: 18px;
	}

	.storeItem {
		font-size: 18px;
	}

	.hatPreview {
		width: 50px;
		height: 50px;
	}

	.joinAlBtn,
	.itemPrice {
		font-size: 18px;
	}

	#itemInfoHolder {
		top: 51px;
	}

	#leaderboardButton {
		display: block;
		right: 8px;
		bottom: 60px;
		top: initial;
	}
}

@media only screen and (max-width: 480px) {
	#storeButton {
		top: 8px;
		left: 86px;
	}

	#allianceButton {
		top: 8px;
		left: 150px;
	}

	#leaderboardButton {
		top: 8px;
		left: 214px;
	}

	#gameName {
		margin-bottom: 0;
	}

	#gameName .gameLogo {
		width: clamp(130px, 50vw, 200px);
	}

	.storeTab {
		width: 153px;
		font-size: 24px;
	}

	#storeHolder {
		width: 340px;
	}

	#upgradeHolder {
		width: 80%;
		top: 50%;
		left: 10%;
		margin-top: -40px;
	}

	#upgradeCounter {
		top: 50%;
		margin-top: -70px;
		background-color: rgba(50, 50, 50, 0.5);
	}

	#upgradeHolder .actionBarItem {
		width: 76px;
		height: 76px;
	}
}

#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%;
}

#bottomContainer {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
}

/* Enter game shell */
:root {
	--accent: #7ee559;
	--accent-dark: #6fc94e;
	--berry: #a56dc8;
	--sky: #6eb3ef;
	--ink: #1d1d1d;
	--outline: #292929;
	--shadow: 0px 7px #c4c4c4;
	--panel: rgba(255, 255, 255, 0.12);
}

#mainMenu {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 28px 12px 32px;
	position: fixed;
	inset: 0;
	box-sizing: border-box;
}

.menuTopActions {
	position: absolute;
	top: 20px;
	left: 20px;
	display: flex;
	gap: 10px;
	z-index: 25;
}

.authButton {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 12px;
	border: 3px solid var(--outline);
	background: rgba(255, 255, 255, 0.92);
	color: var(--ink);
	text-transform: uppercase;
	letter-spacing: 0.4px;
	font-weight: 700;
	box-shadow: var(--shadow);
	cursor: pointer;
	backdrop-filter: blur(10px);
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

.authButton.primary {
	background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
	color: #0f2a12;
	border-color: #2f713e;
}

.authButton.ghost {
	border-color: var(--berry);
	color: var(--berry);
}

.authButton:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px #b0b0b0;
	filter: brightness(1.02);
}

.authButton:active {
	transform: translateY(0);
	box-shadow: 0 6px #b0b0b0;
}

.authButton i {
	font-size: 18px !important;
}

#menuContainer {
	position: relative;
	top: auto;
	left: auto;
	transform: none;
	margin: 0 auto;
	width: min(1100px, 100%);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 100vh;
	white-space: normal;
	text-align: center;
}

#loadingText {
	color: #fff;
	margin: 6px 0 4px;
	text-shadow: 0 1px 0 #1d1d1d;
}

#menuCardHolder {
	width: 100%;
	display: grid;
	gap: 16px;
	justify-items: center;
	align-items: center;
	justify-content: center;
	align-content: center;
}

.enterShell {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 18px 14px 18px;
	text-align: center;
}

.heroCard {
	min-height: 400px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding-top: 16px;
}

.playRow {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
	justify-content: center;
	padding-top: 20px;
}

.compactInput {
	max-width: 200px;
	min-width: 160px;
	width: 180px;
	flex: 0 0 auto;
	height: 48px;
	padding: 10px 12px;
	box-sizing: border-box;
	line-height: 24px;
	margin: 0;
	border-radius: 10px;
}

.playRow .ctaButton {
	height: 48px;
	box-sizing: border-box;
	margin: 0;
	padding: 0 18px;
	border: 3px solid var(--outline);
	border-radius: 10px;
}

.iconSquare {
	width: 48px;
	height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 3px solid var(--outline);
	border-radius: 12px;
	background: #f6f6f6;
	box-shadow: 0 5px #c4c4c4;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.iconSquare:hover {
	transform: translateY(-2px);
	box-shadow: 0 7px #b0b0b0;
}

.iconSquare i {
	font-size: 24px !important;
	color: var(--berry);
}

.playRow input,
.playRow button {
	vertical-align: middle;
}

.heroCard .playRow {
	margin-top: 16px;
}

.titleStack {
	position: relative;
	padding: 8px 12px 4px;
}

.gameTitle {
	font-size: clamp(38px, 7vw, 72px);
	letter-spacing: 6px;
	text-shadow: 0 1px 0 #c4c4c4, 0 2px 0 #c4c4c4, 0 3px 0 #c4c4c4, 0 4px 0 #c4c4c4, 0 5px 0 #c4c4c4, 0 6px 0 #c4c4c4;
}

.titleSub {
	margin-top: 6px;
	color: var(--accent);
	text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
	letter-spacing: 1px;
}

.card {
	/* background: var(--card);
	color: var(--ink);
	border-radius: 10px; */
	/* box-shadow: var(--shadow); */
	/* border: 3px solid rgba(0, 0, 0, 0.05); */
}

.ctaPanel {
	width: min(960px, 100%);
	padding: 0 10px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ctaButtons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center;
}

.ctaButton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 14px 22px;
	font-size: 18px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
	box-shadow: 0 7px #c4c4c4;
	color: #fff;
}

.ctaButton.primary {
	background: linear-gradient(135deg, #6fe08a 0%, #52c46c 100%);
	border: 3px solid #2f713e;
}

.ctaButton.ghost {
	background: #fff;
	color: var(--berry);
	border: 3px solid var(--berry);
}

.ctaButton:hover {
	transform: translateY(-3px);
	filter: brightness(1.02);
	box-shadow: 0 10px #b0b0b0;
}

.ctaButton:active {
	transform: translateY(0);
	box-shadow: 0 4px #b0b0b0;
}

.ctaButton i {
	font-size: 22px !important;
}

.entryForm {
	width: min(960px, 100%);
	padding: 18px;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 14px;
}

.inputField {
	display: flex;
	flex-direction: column;
	gap: 10px;
	text-align: left;
}

.inputField.inline {
	flex-direction: column;
}

.fieldLabel {
	font-size: 15px;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	color: #4b4b4b;
}

.enterShell input[type="text"],
.enterShell input[type="number"],
.enterShell input[type="password"],
.enterShell input[type="email"],
.enterShell select,
.enterShell textarea,
.settingsCard input[type="text"],
.settingsCard input[type="number"],
.settingsCard input[type="password"],
.settingsCard input[type="email"],
.settingsCard select,
.settingsCard textarea {
	width: 100%;
	padding: 12px 14px;
	font-size: 18px;
	background: #f9fbf5;
	border: 3px solid var(--outline);
	border-radius: 10px;
	color: var(--ink);
	box-shadow: inset 0 4px rgba(0, 0, 0, 0.05), 0 6px #c4c4c4;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
	box-sizing: border-box;
}

.enterShell input[type="text"]:focus,
.enterShell input[type="number"]:focus,
.enterShell input[type="password"]:focus,
.enterShell input[type="email"]:focus,
.enterShell select:focus,
.enterShell textarea:focus,
.settingsCard input[type="text"]:focus,
.settingsCard input[type="number"]:focus,
.settingsCard input[type="password"]:focus,
.settingsCard input[type="email"]:focus,
.settingsCard select:focus,
.settingsCard textarea:focus {
	border-color: var(--accent);
	box-shadow: 0 6px #a5d67b;
	transform: translateY(-2px);
}

.enterShell select,
.settingsCard select {
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
	background-position: calc(100% - 24px) calc(50% - 2px), calc(100% - 16px) calc(50% - 2px);
	background-size: 8px 8px, 8px 8px;
	background-repeat: no-repeat;
}

.colorField .colorControls {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	justify-content: center;
}

.colorField .colorLabel {
	font-size: 13px;
	font-weight: 600;
	color: #3a3a3a;
}

.enterShell input[type="color"] {
	width: 64px;
	height: 64px;
	padding: 0;
	border: 3px solid var(--outline);
	border-radius: 12px;
	box-shadow: 0 6px #c4c4c4;
	cursor: pointer;
	background: #fff;
}

.swatchRow {
	display: inline-flex;
	gap: 8px;
	flex-wrap: wrap;
}

.colorSwatch {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 3px solid var(--outline);
	background: var(--swatch);
	box-shadow: 0 4px #c4c4c4;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.colorSwatch:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px #b0b0b0;
}

.modal {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.modal.active {
	display: flex;
}

.modalBackdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(4px);
	z-index: 0;
}

.settingsCard {
	position: relative;
	width: min(1100px, 95vw);
	height: min(760px, 90vh);
	min-height: 620px;
	overflow: hidden;
	padding: 20px;
	z-index: 1;
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border: 3px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
	border-radius: 12px;
}

.settingsHeader {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.closeSquare {
	min-width: 44px;
	height: 44px;
	border-radius: 8px;
	border: 3px solid var(--outline);
	background: #f6f6f6;
	display: grid;
	place-items: center;
	font-size: 18px;
	cursor: pointer;
	box-shadow: 0 5px #c4c4c4;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.closeSquare:hover {
	transform: translateY(-2px);
	box-shadow: 0 7px #b0b0b0;
}

.settingsTabs {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin: 0;
	border-bottom: none;
	padding-bottom: 0;
	flex: 1;
}

.settingsTab {
	padding: 10px 14px;
	border-radius: 8px 8px 0 0;
	border: 3px solid transparent;
	border-bottom: 4px solid transparent;
	background: transparent;
	color: var(--ink);
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
	font-size: 15px;
	letter-spacing: 0.4px;
}

.settingsTab:hover {
	color: var(--accent);
}

.settingsTab.active {
	background: #f7f9f3;
	border-color: transparent transparent var(--accent) transparent;
	color: var(--ink);
	box-shadow: inset 0 -4px 0 0 var(--accent);
}

.settingsContent {
	display: none;
	flex: 1;
	overflow: auto;
}

.settingsContent.active {
	display: block;
}

.settingsGrid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 12px;
}

.settingsSection {
	padding: 18px 14px;
	background: #f7f9f3;
	border: 3px solid #dfe6d2;
	border-radius: 10px;
	box-shadow: inset 0 3px rgba(0, 0, 0, 0.03);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.sectionTitle {
	font-size: 16px;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	color: #5b5b5b;
}

.toggleField {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 16px;
	color: #303030;
	cursor: pointer;
}

.keybindsList {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.settingsCard input[type="checkbox"],
.settingsCard input[type="radio"] {
	appearance: none;
	width: 22px;
	height: 22px;
	border: 3px solid var(--outline);
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 5px #c4c4c4 inset, 0 5px #c4c4c4;
	position: relative;
	cursor: pointer;
}

.settingsCard input[type="radio"] {
	border-radius: 50%;
}

.settingsCard input[type="checkbox"]:checked {
	background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}

.settingsCard input[type="checkbox"]:checked::after {
	content: '';
	position: absolute;
	inset: 3px 5px;
	border: 3px solid #fff;
	border-top: none;
	border-left: none;
	transform: rotate(45deg);
}

.settingsCard input[type="radio"]:checked {
	background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}

.settingsCard input[type="radio"]:checked::after {
	content: '';
	position: absolute;
	inset: 4px;
	background: #fff;
	border-radius: 50%;
}

.rangeField {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.rangeHeader {
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: #4b4b4b;
}

.rangeValue {
	font-weight: bold;
	color: var(--ink);
}

.settingsCard input[type="range"] {
	-webkit-appearance: none;
	width: 100%;
	height: 14px;
	border-radius: 12px;
	background: linear-gradient(90deg, var(--accent), var(--berry));
	border: 3px solid var(--outline);
	box-shadow: inset 0 3px rgba(0, 0, 0, 0.2), 0 5px #c4c4c4;
}

.settingsCard input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #fff;
	border: 4px solid var(--accent);
	box-shadow: 0 6px #b0b0b0;
	cursor: pointer;
}

.settingsCard input[type="range"]::-moz-range-thumb {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #fff;
	border: 4px solid var(--accent);
	box-shadow: 0 6px #b0b0b0;
	cursor: pointer;
}

body.modal-open {
	overflow: hidden;
	height: 100vh;
}

@media (max-width: 720px) {
	.enterShell {
		padding-top: 18px;
	}

	.ctaButtons {
		flex-direction: column;
	}

	.ctaButton {
		width: 100%;
	}

	.settingsCard {
		max-height: 88vh;
	}
}

/* Footer Styles */
#pageFooter {
	position: fixed;
	bottom: 10px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 15px;
	align-items: center;
	justify-content: center;
	z-index: 9998;
	padding: 8px 16px;
	background-color: rgba(0, 0, 0, 0.3);
	border-radius: 8px;
	backdrop-filter: blur(5px);
}

.footerLink {
	color: rgba(255, 255, 255, 0.85);
	font-size: 11px;
	text-decoration: none;
	font-weight: 600;
	letter-spacing: 0.5px;
	transition: color 0.2s ease, transform 0.2s ease;
	padding: 4px 8px;
	border-radius: 4px;
}

.footerLink:hover {
	color: #7ee559;
	transform: translateY(-1px);
	background-color: rgba(255, 255, 255, 0.1);
}

.footerLink:active {
	color: #6fc94e;
	transform: translateY(0);
}

.footerLink:visited {
	color: rgba(255, 255, 255, 0.85);
}

.footerLink:visited:hover {
	color: #7ee559;
}
