/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f0f4f8;
  color: #333;
  text-align: center;
  padding: 20px;
  padding-bottom: 100px; /* reserve space for bottom nav */
}

/* Top Navigation Bar */
#tabs-top {
  background-color: #4CAF50;
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  flex-wrap: wrap;
}

#tabs-top a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 10px;
  transition: background 0.3s;
}

#tabs-top a:hover {
  background-color: #45a049;
  border-radius: 5px;
}

/* Bottom Navigation Bar */
#tabs-bottom {
  background-color: #333;
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 1000;
  flex-wrap: wrap;
}

#tabs-bottom a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 10px;
  transition: background 0.3s;
}

#tabs-bottom a:hover {
  background-color: #555;
  border-radius: 5px;
}

/* Footer */
footer {
  margin-top: 50px;
  font-size: 0.9em;
  color: #888;
  padding-bottom: 20px;
}

/* Heading */
h1 {
  font-size: 2.5em;
  margin: 30px 0 20px;
  color: #2c3e50;
}

/* Controls */
#controls {
  margin: 20px 0;
}

#controls button {
  background-color: #3498db;
  border: none;
  color: white;
  padding: 10px 20px;
  margin: 5px;
  font-size: 1em;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

#controls button:hover {
  background-color: #2980b9;
  transform: scale(1.05);
}

/* Score and Timer */
#score-time {
  margin: 20px 0;
  font-size: 1.2em;
}

#score-time span {
  margin: 0 15px;
}

/* Game Board */
#game-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 15px;
  margin: 20px auto;
  max-width: 600px;
  padding: 0 10px;
}

/* Game Tiles */
#game-board div {
  background-color: orangered;
  height: 100px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6em;
  cursor: pointer;
  transition: transform 0.3s, background-color 0.3s;
  user-select: none;
}

#game-board div:hover {
  transform: scale(1.05);
  background-color: yellow;
}

/* Matched Tile */
.tile.matched {
  background-color: #2ecc71;
  color: white;
  pointer-events: none;
  transform: scale(1.1);
}

/* Unmatched (wrong guess) animation */
.tile.wrong {
  background-color: #e74c3c;
  color: white;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
  100% { transform: translateX(0); }
}

/* Responsive Tweaks */
@media (max-width: 600px) {
  h1 {
    font-size: 2em;
  }

  #controls button {
    font-size: 0.9em;
    padding: 8px 16px;
  }

  #game-board {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }

  #tabs-top, #tabs-bottom {
    flex-direction: column;
    align-items: center;
  }
}
