@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,500;0,700;1,300;1,500;1,700&display=swap");

*,
*:before,
*:after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	scroll-behavior: smooth;
	list-style: none;
	list-style-type: none;
	outline: none;
	text-decoration: none;
	border: none;
	-webkit-box-sizing: inherit;
	box-sizing: inherit;
}

html {
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
}

body {
	font-family: "Rubik", sans-serif;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-orient: vertical;
	-webkit-box-direction: normal;
	-ms-flex-direction: column;
	flex-direction: column;
	-webkit-box-pack: center;
	-ms-flex-pack: center;
	justify-content: center;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
}

h1 {
	-webkit-margin-before: 0;
	margin-block-start: 0;
	-webkit-margin-after: 0;
	margin-block-end: 0;
	color: inherit;
}

#title {
	color: #000000;
	font-size: 3em;
	margin: 0.7rem;
	padding: 0.7rem 1.5rem;
	border: #000000 solid 0.3rem;
	border-radius: 1rem;
}

#panel {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	max-width: 97vw;
	width: 24.5rem;
	-ms-flex-pack: distribute;
	justify-content: space-around;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
}

#scoreboard {
	padding-left: 1.4em;
	width: 12em;
}

#score {
	margin-left: 0.4em;
	padding-right: 0.3em;
}

#plus {
	border-radius: 0.4em;
	padding: 0.3em;
	opacity: 0;
}

#play {
	color: #000000;
	background-color: transparent;
	font-size: 1em;
	font-weight: 700;
	width: 7em;
	height: 3em;
	border: #000000 solid 0.3rem;
	border-radius: 0.4em;
	margin: 1em;
	cursor: pointer;
	outline: none;
}

section{
	display: flex;
}

#container {
	position: relative;
	margin-top: 1.1em;
	margin-bottom: 1em;
}

#grid {
	padding: 0.8em;
	display: -ms-grid;
	display: grid;
	grid: repeat(4, minmax(0, 1fr)) / repeat(4, minmax(0, 1fr));
	gap: 0.8em;
	max-width: 97vw;
	width: 24.5rem;
	max-height: 98vw;
	height: 25rem;
	border-radius: 0.8em;
}

#cover {
	position: absolute;
	top: 0;
	padding: 0.8em;
	display: -ms-grid;
	display: grid;
	grid: repeat(4, minmax(0, 1fr)) / repeat(4, minmax(0, 1fr));
	gap: 0.8em;
	background-color: rgba(160, 60, 60, 0);
	max-width: 97vw;
	width: 24.5rem;
	max-height: 98vw;
	height: 25rem;
	border-radius: 0.8em;
}

#cover .square {
	opacity: 0;
}

.square {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-pack: center;
	-ms-flex-pack: center;
	justify-content: center;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	border-radius: 0.4em;
	-webkit-transform: translate(0, 0);
	transform: translate(0, 0);
}

.square h1 {
	font-family: "Montserrat", sans-serif;
	font-size: 1.5em;
}

.gameover {
	opacity: 0.5;
}

#gameover {
	display: none;
	font-size: 4em;
	font-weight: 900;
	position: relative;
	top: -15rem;
	height: 0;
	text-align: center;
}

#game-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-top: 1em;
}

#container {
    margin-right: 20px; /* Espace entre la grille et le panneau */
}

#theme-panel {
    margin: 0;
	margin-top: 1.2em;
    padding: 1em;
    background-color: #f8f8f8;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 300px;
    text-align: center;
}

#theme-panel label {
    font-weight: bold;
    color: #333;
    display: block;
    margin-bottom: 0.5em;
}

#theme-panel select {
    width: 100%;
    padding: 0.5em;
    border-radius: 4px;
    border: 1px solid #bbb;
    font-size: 1em;
    background-color: #fff;
    color: #333;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    appearance: none;
    cursor: pointer;
}

#theme-panel select:hover {
    border-color: #888;
}

#theme-panel select:focus {
    outline: none;
    border-color: #555;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

@media (max-width: 400px) {
	html {
		font-size: 14px;
	}
}

@media (max-width: 400px) {

	#grid,
	#cover {
		gap: 6px;
		padding: 6px;
	}
}

@media (max-width: 300px) {
	.square h1 {
		font-size: 1.3em;
	}
}