@import './chessground.base.css';
@import './chessground.brown.css';
@import './chessground.cburnett.css';

:root {
	--bulma-primary: hsla(
		var(--bulma-primary-h),
		var(--bulma-primary-s),
		var(--bulma-primary-l),
		1
	);
	--bulma-primary-base: hsla(
		var(--bulma-primary-h),
		var(--bulma-primary-s),
		var(--bulma-primary-l),
		1
	);
	--bulma-primary-rgb: 10, 220, 155;
	--bulma-primary-h: 160deg;
	--bulma-primary-s: 100%;
	--bulma-primary-l: 30%;
	--bulma-primary-00-l: 1%;
	--bulma-primary-05-l: 6%;
	--bulma-primary-10-l: 11%;
	--bulma-primary-15-l: 16%;
	--bulma-primary-20-l: 21%;
}

html {
	height: 100%;
	overflow-x: hidden;
}

body {
	width: 100%;
	min-height: 100%;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}

#container {
	width: 100%;
	flex: 1;
	display: flex;
}

#board-container {
	width: 100%;
	position: relative;
}

@media screen and (max-width: 768px) {
	#container {
		flex-direction: column-reverse;
		align-items: center;
	}

	#board-container {
		flex: 1;
	}

	#board-ui {
		display: flex;
		justify-content: center;
	}

	#controls {
		flex-direction: row !important;
		width: 100%;
	}

	#board {
		width: 96%;
		aspect-ratio: 1;
	}
}

@media screen and (min-width: 769px) {
	#container {
		justify-content: center;
		padding-top: clamp(0.5rem, 2vw, 1rem);
		padding-left: 0.1rem;
		padding-right: 0.1rem;
	}

	#board-container {
		flex: 4;
	}

	#board-ui {
		margin-right: 7%;
		display: flex;
		justify-content: flex-end;
	}

	#controls {
		width: 100%;
		flex: 1;
	}

	#board {
		width: 400px;
		aspect-ratio: 1;
	}
}

#controls {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	align-items: center;
	justify-content: center;
	min-width: 100px;
	padding: 1rem;
}

#clocks {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.time {
	border-radius: 5%;
	border: 2px solid hsl(220deg 14.02% 20.98%);
	display: flex;
	justify-content: center;
	width: 50%;

	&.is-running {
		border: 2px solid rgb(15, 158, 15);

		&#white-clock {
			background: rgb(240, 240, 240);
		}

		&#black-clock {
			background: rgb(110, 110, 110);
		}
	}
}

#white-clock {
	background: rgb(197, 197, 197);
	color: black;
	padding: 0.25em;
}

#black-clock {
	background: rgb(40, 40, 40);
	padding: 0.25em;
	/* border-top: 1px solid hsl(220deg 14.02% 20.98%); */
}

#game-meta {
	visibility: hidden;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 0.5rem;
	margin: 0.75rem auto;
	gap: 1rem;
	min-height: 64px;
	min-width: min(368px, 90vw);
}

.is-black {
	background-color: var(--bulma-body-color);
	color: var(--bulma-body-background-color);
	padding: 2px;
	border-radius: 2px;
}

#whose-move {
	display: flex;
}

@keyframes fade {
	0% {
		opacity: 0;
	}
	50% {
		opacity: 1;
	}
	100% {
		opacity: 0;
	}
}

piece.black.fade {
	animation: fade 2.5s ease-in-out infinite;
}

#countdown-container {
	background-color: transparent;
	font-size: clamp(2rem, 8vw, 6rem);
	position: absolute;
	z-index: 5;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	-webkit-text-stroke: 2px black;
	color: white;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;

	> div {
		display: flex;
		justify-content: center;
	}
}

#board {
	pointer-events: none;
}

@media screen and (min-width: 1024px) {
	#board {
		width: 500px;
		height: 500px;
	}
}
/* 
@media screen and (min-width: 768px) and (max-width: 1023px) {
	#board {
		width: 400px;
		height: 400px;
	}
}

@media screen and (min-width: 480px) and (max-width: 767px) {
	#board {
		width: 300px;
		height: 300px;
	}
} */

#getting-started {
	z-index: 5;
	position: fixed;
	width: 100%;
	height: 100vh;
	background: transparent;
	display: flex;
	justify-content: center;
	margin-top: clamp(1rem, 4vw, 3rem);
	font-weight: 500;
	padding: 0 1rem;
}

#button-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	margin-top: 1rem;
}

@media screen and (max-width: 768px) {
	#button-container {
		flex-direction: column;
		align-items: center;
		gap: 0.5rem;
	}
}

#game-status-modal {
	position: fixed;
	z-index: 5;
	background-color: var(--bulma-body-background-color);
	left: 50%;
	transform: translateX(-50%);
	margin-top: clamp(60px, 10vw, 110px);
	border: 2px solid #cccccc28;
	border-radius: 0.5rem;
	width: min(90%, 400px);
}

#modal-header {
	display: flex;
	font-size: 1.25rem;
	justify-content: center;
	padding: 0.5rem;
	display: flex;
	align-items: center;
	border-bottom: 2px solid #cccccc28;
}

#modal-content {
	display: flex;
	padding: 0.5rem;
	flex-direction: column;
}

#modal-button-container {
	display: flex;
	justify-content: flex-end;
}

#modal-button-container button {
	margin: 0px 6px;
}

#footer {
	width: 100%;
	display: flex;
	gap: 3rem;
}

#test-board {
	z-index: 11;
	margin-left: 40px;
	display: none;
	width: 400px;
	height: 400px;
	position: absolute;
	border: 18px solid black;
}

.dropdown-menu:hover {
	cursor: pointer;
}
