body {
	margin-top: -55px;
	font-family: var(--norm-font);
}

.block {
	max-width: 95%;
}

#period {
	display: flex;
	justify-content: center;
	margin-top: 1vw;
}

#period__box {
	position: relative;
	display: inline-block;
	vertical-align: top;
	font-family: var(--bold-font);
	letter-spacing: 0.2vw;
	flex: 5;
	margin-left: 1vw;
	margin-right: 1vw;
	overflow: hidden;
	font-size: 0;
	border-radius: 0;
	transition: 0.3s;
}

#period__header {
	width: 60vw;
	font-size: 4vw;
	margin: 2vw auto 0.5vw;
	padding: 0;
	border: 0;
	text-align: center;
	font-family: var(--bold-font);
	letter-spacing: 0.2vw;
}

#period__header:focus-visible {
	outline: 0;
}

#period__header.active:focus-visible {
	border-bottom: 0.5vw solid var(--secondary-background-color);
	margin-bottom: 0;
}

#period__time {
	letter-spacing: 0;
	font-size: 8vw;
	margin: 0.5vw 0 2vw;
}

#period__gallery {
    min-height: 8.4vw;
}

.gallery-dot {
    width: 4.2vw;
    padding: 4.2vw 0 0;
    border-radius: 50%;
    display: inline-block;
    margin: 0 1.5vw 3vw;
    position: relative;
    background-color: var(--gallery-dot-color);
}

.gallery-dot.active {
    background-color: var(--active-color);
	background-image: var(--active-gradient);
}

.gallery-dot:before {
    content: '';
    position: absolute;
    background-color: transparent;
    top: -1.1vw;
    left: -1.1vw;
    right: -1.1vw;
    bottom: -1.1vw;
    border-radius: 1.1vw;
}

.arrow {
	vertical-align: middle;
	flex: 1;
	padding: 0;
	margin: 0;
	font-size: 15vw;
	display: inline-block;
	top: 0px;
	font-family: var(--norm-font);
	transition: 0.3s;
}

.arrow:hover {
	background-color: var(--button-hover-background);
	color: var(--button-hover-text);
	transition: 0.3s;
}

#countdown {
	letter-spacing: 0.5vw;
	font-family: var(--bold-font);
	text-align: center;
	font-size: 0;
	overflow-y: hidden;
	transition: 0.3s;
}

#countdown__timer {
	position: relative;
	padding: 0;
	margin: 0;
	font-size: 12vw;
	color: var(--countdown-text-color);
	transition: 0.3s;
}

#countdown__bar, #hall-pass .countdown__bar {
	position: relative;
	margin: 0 auto 2vw;
	width: 90%;
	height: 2.5vw;
	background-color: var(--secondary-background-color);
	overflow-x: hidden;
}

#countdown__progress, #hall-pass .countdown__bar .countdown__progress {
	width: 0%;
	height: 2.5vw;
	background-color: var(--active-color);
	background-image: var(--active-gradient);
	transition: width 1s linear;
}

#sub.hidden {
	display: none;
}

#sub div {
	display: flex;
}

#sub div button {
	vertical-align: middle;
	flex: 1;
	padding: 2vw;
	font-size: 8vw;
	display: inline-block;
	top: 0px;
	font-family: var(--bold-font);
}

.home-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0px;
    font-weight: bold;
    position: relative;
    padding: 7px 10px;
    color: var(--button-text-color-alt);
	font-size: 42px;
	user-select: none;
	font-family: robotobold;
}

/* Prevent background content from scrolling when the modal is open */
body.modal-open {
  overflow: hidden;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1020;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgb(0,0,0);
  background-color: rgba(0,0,0,0.4);
}

.modal-content {
  background-color: var(--navigation-background-color);
  position: relative;
  margin: 0 auto 0;
  top: 50%;
  transform: translateY(calc(-15% - 40%));
  padding: 20px;
  border: 2px solid var(--active-color);
  border-radius: 5px;
  text-align: center;
  font-size: calc(0.75vw + 15px);
  width: 60%;
  min-width: 350px;
}

#chessboard {
	width: 300px;
}

h2 {
	margin: 10px -15px;
}

p {
	margin: 10px 10px;
}

.puzzle input[type="text"].puzzle-answer {
    width: 90%;
    height: 50px; /* Adjust height as needed to maintain the square appearance */
    margin: 10px auto;
	font-size: 24px;
    display: block;
    background-color: var(--container-background-color); /* Change the background color to white or any color you prefer */
    color: var(--container-text-color); /* Change text color to dark for contrast */
    border-bottom: 3px solid var(--active-color); /* Thicker bottom border */
    box-sizing: border-box;
	outline: none; /* Remove the default focus outline */
	box-shadow: none;
	text-align: center; /* Align the text to the center */
}

.puzzle button {
    width: 90%;
    height: 50px; /* Adjust to match the input height or as needed */
    margin: 0 auto;
    display: block;
    background-color: var(--active-color); /* Dark background for the button */
    color: var(--button-text-color-alt);
    border: 2px solid var(--dark-color); /* Consistent with the input field */
    padding: 0;
    box-sizing: border-box;
    text-align: center;
    cursor: pointer;
	font-size: 32px;
	font-family: robotobold;
	transition: 0.3s;
}

.puzzle button:hover {
	background-color: var(--active-hover-color);
	transition: 0.3s;
}

.feedback-message {
	font-size: 18px;
	color: red;
}

.locked-theme::before {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../img/lock.svg') no-repeat center center;
  background-size: contain;
  opacity: 0.5;
}

#themes_shop_container {
	margin-top: -14px;
	margin-bottom: 2px;
	justify-self: center;
	max-width: 400px;
	user-select: none;
}

#theme_selector {
	display: inline-block;
	position: relative;
	width: 215px;
	height: 30px;
	font-size: 20px;
	text-align: center;
	text-decoration: none;
	font-family: robotobold;
	cursor: pointer;
	color: var(--button-text-color-alt);
	pointer-events: visible;
	background-size: 26px; /* Reduces the size of the background image to create a 2px border around it */
	background-position: 4px 50%;
	border: 2px solid black;
	margin-left: 5px;
	margin-right: 5px;
}

/* Assuming a direct gradient definition for demonstration */
.theme-button[data-theme="gradient"] {
    background-size: cover;
    background-position: center; /* Centers the gradient */
}

#themes_blur {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	font-size: 10px;
	background-color: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(5px);
	z-index: 1000;  /* Make sure the modal appears on top */
}

#themes_selector {
	position: absolute;
	top: 40%;
	left: 50%;
	transform: translate(-50%, -50%);
	background-color: var(--container-background-color);
	border: 2px solid var(--active-color);
	padding: 20px;
	max-height: 80vh;
	border-radius: 8px;
	text-align: center;
	font-size: 30px;
	font-family: robotobold;
	overflow-y: scroll;  /* Make content scrollable */
	width: calc(250px + 25vw);
	max-width: 450px;
	min-height: 100px;
	z-index: 1001;
	box-sizing: border-box;  /* To include padding and border in the element's total width and height */
}

#end_year_countdown {
    margin-top: -10px;
    font-size: 20px;
    font-family: robotobold;
    color: var(--header-text-color);
}

.theme-button {
  display: inline-block;
  position: relative;
  background-position: center;
  width: 80px;
  height: 50px;
  cursor: pointer;
  border: 2px solid black;
  margin-left: 5px;
  margin-right: 5px;
}

.theme-button::after {
  content: '';
  display: none;
  position: absolute;
  top: 4px; /* 2px from the top edge of the <a> element */
  left: 2px; /* 2px from the left edge of the <a> element */
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  background-image: url('../img/checkmark.svg'); /* Replace with your checkmark icon */
  background-position: center;
  background-repeat: no-repeat;
}

.theme-button.active::after {
  display: block;
}

#chessboard {
	margin: -10px auto 10px;
}

.lunch-btn {
	width: calc(25%); /* Divides the width into fourths */
	height: 75px; /* Adjust this value if you want the buttons taller or shorter */
	font-size: 2.5em; /* Adjust the font size as needed */
	text-align: center;
	display: inline-block;
	vertical-align: middle;
	font-family: robotobold;
	padding: 0;
	margin: 0;
	position: relative;
	background-color: transparent;
    transition: color 0.2s, background-color 0.2s;
}

.lunch-btn::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-image: linear-gradient(var(--active-color), var(--active-color));
    z-index: -1;
    transition: opacity 0.2s;
    opacity: 0;
}

.game-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5vh;
    width: 50vh; /* Responsive width */
    height: 50vh; /* Responsive height, keeps the aspect ratio */

	max-width: 90%;
	max-height: 90%;
    margin: auto auto 10px;
    background-color: #bbada0;
    padding: 0.5vw;
    border-radius: 10px;
    grid-auto-rows: 1fr;
}

.game-tile {
    background-color: #cdc1b4;
    text-align: center;
    line-height: 4.5vw; /* Responsive line-height */
    font-size: 2.5vw; /* Responsive font-size */
	width: 100%;
	height: auto;
    font-weight: bold;
    border-radius: 5px;
	color: white;
    transition: background-color 0.1s ease-in-out, transform 0.1s ease-in-out;
}

.game-tile.merging {
    animation: mergeTile 0.1s forwards;
}

@keyframes mergeTile {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}


.lunch-btn.selected::before {
    opacity: 1;
}

.lunch-btn::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.lunch-btn:hover::after {
    opacity: 1;
}

.lunch-btn.selected {
    color: var(--button-text-color-alt); /* Make text white when selected */
    background-color: var(--active-color); /* Make selected buttons red */
}

.lunch-btn.selected:hover {
    background-color: rgba(var(--active-color), 0.8); /* Darken the red background on hover */
}

#lunch__choose {
    white-space: nowrap;
	box-sizing: border-box;
	display: flex;
    overflow: hidden; /* or overflow: auto; if you prefer to have a scrollbar when content overflows */
}

#lunch__choose {
	text-align: center;
	width: 100%;
	margin-bottom: 0;
}

.l-margin.r-margin.lunch-btn {
	width: calc(25%); /* Since this button has margins, we don't subtract the 2vw from the width */
}


#sub div button.active {
	background-color: var(--active-color);
	color: var(--button-active-color);
}

#sub div button.active:hover {
	background-color: var(--active-hover-color);
	color: var(--button-active-color);
}

#lunch #lunch__toggle #lunch__choose {
  width: 100%;
  vertical-align: middle;
  padding: 0vw;
  font-size: 5vw;
  display: inline-block;
  box-sizing: content-box;
  top: 0;
  bottom: 0;
  font-family: var(--bold-font);
}

#feedback-form {
	width: calc(200px + 30vw);
	margin: -50px auto 100px;
	padding: 2px 2px 18px;
	border-radius: 5px;
	outline: 2px solid var(--active-color);
}

.link {
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--dark-color); /* Adjusted for proper syntax */
    background-color: var(--active-color);
    color: var(--button-text-color-alt);
    max-width: 90%;
    height: 30px;
    margin: 0 auto;
    width: 200px;
    text-decoration: none !important; /* Ensures the text does not have an underline */
    cursor: pointer; /* Makes the mouse cursor change to a pointer, indicating it's clickable */
}

.marginal {
	margin-top: -20px;
}

.icon-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 20px; /* Adjust the margin below the buttons as needed */
}

.icon-button {
	background-color: var(--button-active-color) !important;
	opacity: 1;
	margin: 4px;
    display: flex;
	width: calc(100% / 3);
	justify-content: center;
    padding: 10px;
    transition: background-color 0.3s ease;
}

.icon-button:hover {
    background-color: var(--button-hover-background) !important; /* Adjust the hover background color as needed */
}

.icon-button img {
    width: 50px; /* Adjust the width of the icon as needed */
    height: auto;
}

@media screen and (min-width: 500px) {
	#help-popup {
		padding: 10px;
		font-size: 20px;
		bottom: 60px;
	}

	#period {
		margin-top: 5px;
	}

	#period__box {
		letter-spacing: 1px;
		margin-left: 5px;
		margin-right: 5px;
	}

	#period__header {
		width: 300px;
		font-size: 20px;
		margin: 10px auto 2.5px;
		letter-spacing: 1px;
		transition: 0.3s;
	}

	#period__header.active:focus-visible {
		border-bottom: 2.5px solid var(--secondary-background-color);
		background-color: var(--container-text-color);
	}

	#period__time {
		font-size: 40px;
		margin: 2.5px 0 10px;
	}

	#period__gallery {
		min-height: 42px;
	}

	.gallery-dot {
		width: 21px;
		padding: 21px 0 0;
		margin: 0 7.5px 15px;
		transition: 0.3s;
	}

	.gallery-dot:before {
		top: -5px;
		left: -5px;
		right: -5px;
		bottom: -5px;
		border-radius: 5px;
	}

	.arrow {
		font-size: 75px;
		flex: none;
		width: 67px;
	}

	#countdown {
		letter-spacing: 2.5px;
		margin: 0 auto 0;
	    justify-content: center;
	    align-items: center;
	}

	#countdown__timer {
		font-size: 60px;
	}

	#countdown__bar, .countdown__bar {
		margin: 0 auto 10px;
		height: 12.5px;
	}

	#countdown__progress, .countdown__bar .countdown__progress {
		height: 12.5px;
	}

	#sub div button {
		padding: 10px;
		font-size: 40px;
	}

}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

/* Keeping the original translateY transformation */
@keyframes shakeThemes {
    0%, 100% { transform: translateY(calc(-15% - 40%)); }
    25% { transform: translate(-5px, calc(-15% - 40%)); }
    50% { transform: translate(5px, calc(-15% - 40%)); }
    75% { transform: translate(-5px, calc(-15% - 40%)); }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

.shakeThemes {
  animation: shakeThemes 0.5s ease-in-out;
}