html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  font-family: 'Segoe UI', sans-serif;
}


#main {
  margin: auto;
  text-align: center;
  padding: 30px 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  border-radius: 20px;
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  width: 100%;
  max-width: 360px;
  animation: fadeIn 1s ease-in-out;
  box-sizing: border-box;
}

h1 {
  font-size: 36px;
  color: #ff6b6b;
  margin-bottom: 10px;
  text-shadow: 2px 2px #ffe5e5;
}

footer {
  text-align: center;
  padding: 12px;
  font-size: 14px;
  color: #555;
  background: transparent;
  font-weight: 500;
  margin-bottom: 10px;
}

footer p {
  margin: 0;
}

footer a {
  color: #ff6b6b;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

footer a:hover {
  color: #e84343;
  text-decoration: underline;
}

#ins {
  margin-bottom: 20px;
  font-size: 18px;
  color: #5c5c5c;
}

.mode-button {
  margin: 10px;
  padding: 12px 24px;
  font-size: 16px;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background: linear-gradient(to right, #48c6ef, #6f86d6);
  color: white;
  transition: transform 0.2s ease, background-color 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.mode-button:hover {
  transform: scale(1.1);
  background: linear-gradient(to right, #6f86d6, #48c6ef);
}

.hidden {
  display: none;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-gap: 8px;
  margin-top: 25px;
}

.cell {
  width: 100px;
  height: 100px;
  border: 3px solid #4a4e69;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  background: linear-gradient(to top left, #f9f7f7, #dbe2ef);
  transition: transform 0.3s, box-shadow 0.3s;
  color: #22223b;
}

.cell:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(74, 78, 105, 0.5);
}

.cell.taken {
  pointer-events: none;
}

.reset {
  margin-top: 25px;
  padding: 12px 24px;
  font-size: 16px;
  cursor: pointer;
  background: linear-gradient(to right, #f6d365, #fda085);
  border: none;
  color: #2f2f2f;
  border-radius: 10px;
  font-weight: bold;
  box-shadow: 0 5px 15px rgba(253, 160, 133, 0.3);
}

.reset:hover {
  background: linear-gradient(to right, #fda085, #f6d365);
  transform: scale(1.05);
}

.message {
  margin-top: 20px;
  font-size: 20px;
  font-weight: bold;
  color: #00b894;
  animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.highlight {
  background-color: #ffeaa7 !important;
  color: #30d635 !important;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.1);
  }
}

.icon-button {
  background: none;
  border: none;
  margin: 10px;
  padding: 8px;
  cursor: pointer;
  transition: transform 0.2s ease;
  border-radius: 8px;
}

.icon-button img {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease;
}

.icon-button:hover img {
  transform: scale(1.2);
}
.image-button {
  background: none;
  border: none;
  margin: 10px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s ease;
}

.image-button img {
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
  transition: transform 0.2s ease;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.2));
}

.image-button:hover img {
  transform: scale(1.1);
}

.image-button span {
  font-size: 14px;
  color: #333;
  font-weight: bold;
}
.mode-button-with-img {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  margin: 10px;
  border: 2px solid #457b9d;
  border-radius: 10px;
  background-color: #f1faee;
  font-size: 16px;
  font-weight: bold;
  color: #1d3557;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.mode-button-with-img:hover {
  background-color: #a8dadc;
  transform: scale(1.05);
}

.mode-button-with-img img {
  width: 32px;
  height: 32px;
}
#mode-select {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap; /* allows wrapping on small screens */
  gap: 20px;
  margin-top: 20px;
}
#game-heading {
  font-size: 24px;
  color: #ff6b6b;
  margin-top: 20px;
  animation: fadeIn 1s ease-in-out;
}

.replay-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
}

.settings-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.hidden {
  display: none !important;
}

footer {
  text-align: center;
  margin-top: 20px;
  padding: 16px 10px;
  font-size: 14px;
  color: #555;
  background: transparent;
  font-weight: 500;
}

footer p {
  margin: 0;
}

footer a {
  color: #ff6b6b;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

footer a:hover {
  color: #e84343;
  text-decoration: underline;
}
