html, body {
  height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  font-family: 'Barlow Condensed', sans-serif;
  background-color: #87CEEB; /* Sky blue background */
  display: flex;
  flex-direction: column;
}

body.modal-open .grid {
  filter: blur(4px);
  opacity: 0.7;
}

body.modal-open .background-elements {
  filter: blur(4px);
}

header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px; /* Fixed height to avoid gap */
  padding: 10px 0; /* Top and bottom padding */
  z-index: 3; /* Ensure header is above all other elements */
}

.logo {
  height: 40px;
  padding-left: 10px; /* Add padding */
}

.title {
  flex-grow: 1;
  text-align: center;
  margin: 0;
  font-size: 1.5rem;
}

.counter {
  font-size: 1.2rem;
  margin-right: 10px;
}

.menu-icon {
  font-size: 1.5rem;
  cursor: pointer;
  padding-right: 10px; /* Add padding */
}

.progress-bar {
  position: fixed;
  top: 60px; /* Adjust to match header height */
  width: 100%;
  height: 8px;
  background-color: #ccc;
  z-index: 2; /* Ensure progress bar is above plates */
}

.progress {
  height: 100%;
  background-color: #4CAF50;
  width: 0%;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  z-index: 20;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.wrapper {
  flex: 1 0 auto;
}

.grid {
  margin-top: 80px; /* To account for the fixed header */
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around; /* Use space-around */
  z-index: 1;
  position: relative;
}

.grid .plate {
  width: 100px;
  height: 50px;
  background-color: #fff;
  border: 2px solid #ccc;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px;
  cursor: pointer;
  text-transform: uppercase;
  text-align: center; /* Center align text inside the plates */
}

.grid .plate.selected {
  background-color: #4CAF50;
  border-color: #388E3C;
  animation: pulse 0.5s;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.background-elements {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.layer1, .layer2, .layer3, .layer4 {
  position: absolute;
  bottom: 0;
  width: 2400px;
  height: 270px;
  background-repeat: repeat-x;
}

.layer1 {
  background: url('layer-1.png');
  animation: moveLeft 300s linear infinite;
}

.layer2 {
  background: url('layer-2.png');
  animation: moveLeft 240s linear infinite;
}

.layer3 {
  background: url('layer-3.png');
  animation: moveLeft 180s linear infinite;
}

.layer4 {
  background: url('layer-4.png');
  animation: moveLeft 120s linear infinite;
}

@keyframes moveLeft {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-480px);
  }
}

.cloud1, .cloud2, .cloud3 {
  position: absolute;
  background: none;
  opacity: 0.7;
}

.cloud1 {
  width: 200px;
  height: 120px;
  bottom: 70vh;
  left: 0px;
  animation: floatCloud 71s linear infinite;
}

.cloud2 {
  width: 240px;
  height: 140px;
  bottom: 60vh;
  left: 0px;
  animation: floatCloud 157s linear infinite;
  animation-delay: -40s;
}

.cloud3 {
  width: 160px;
  height: 100px;
  bottom: 50vh;
  left: 0px;
  animation: floatCloud 271s linear infinite;
  animation-delay: -20s;
}

@keyframes floatCloud {
  0% {
    transform: translateX(-200px);
    opacity: 0.7;
  }
  95%{
    opacity: 0.7;
  }
  100% {
    transform: translateX(1800px);
    opacity: 0;
  }
}

.menu {
  position: fixed;
  top: 50px;
  right: 10px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 15;
}

.menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-item {
  padding: 10px 20px;
  cursor: pointer;
}

.menu-item:hover {
  background: #f0f0f0;
}

.zoom-buttons {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
}

.zoom-in, .zoom-out, .reset-size {
  height: 24px;
  width: 24px;
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
}

.zoom-in:hover, .zoom-out:hover, .reset-size:hover {
  background-color: #ccc;
}

footer {
  background: rgba(255, 255, 255, 0.9);
  text-align: center;
  padding: 10px;
  width: 100%;
}

footer p {
  margin: 0;
}

footer a {
  color: #4CAF50;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}
