@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700&display=swap");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Nunito", "Poppins", sans-serif;
  text-align: center;
  background: linear-gradient(135deg, #fff0f5, #e6e6fa);
  color: #5f676f;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.app-container {
  width: 100%;
  max-width: 500px;
  padding: 20px;
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 30px 15px;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: fadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.screen.active {
  display: flex;
}

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

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #4a4e54;
  margin-bottom: 15px;
  line-height: 1.2;
}

h1 > span {
  font-weight: 700;
}

p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #5f676f;
  margin-bottom: 25px;
  max-width: 350px;
}

#game-container {
  display: grid;
  grid-template-columns: repeat(3, 75px);
  gap: 12px;
  padding: 15px;
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: 15px;
  margin-top: 10px;
}

.cell {
  width: 75px;
  height: 75px;
  background-color: #f8f8f8;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 600;
  color: transparent;
  cursor: pointer;
  transition: transform 0.25s ease-out, box-shadow 0.25s ease-out,
    background-color 0.25s ease-out, color 0.25s ease-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.cell.hidden {
  background-color: #f0f0f0;
}

.cell.revealed {
  background: linear-gradient(135deg, #ffdab9, #ffb6c1);
  color: #ffffff;
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(255, 182, 193, 0.4);
}

.cell:not(.revealed):hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.08);
  background-color: #e8e8e8;
}

.cell.clicked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  animation: ripple 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes ripple {
  to {
    transform: translate(-50%, -50%) scale(25);
    opacity: 0;
  }
}

.cell.clicked {
  transform: scale(0.97);
  transition: transform 0.1s ease-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-4px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(4px);
  }
}

#game-container.error-shake {
  animation: shake 0.4s ease-in-out;
}

button,
.btn {
  margin-top: 10px;
  padding: 12px 28px;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, #ff8fab, #d87093);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(216, 112, 147, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0.5px;
}

button:hover,
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(216, 112, 147, 0.4);
  background: linear-gradient(135deg, #ff7096, #c71585);
}

.btn-secondary {
  background: linear-gradient(135deg, #98fb98, #66cdaa);
  box-shadow: 0 4px 15px rgba(102, 205, 170, 0.3);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #87e987, #54b996);
  box-shadow: 0 7px 20px rgba(102, 205, 170, 0.4);
}

.button-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

#game-message {
  font-size: 1.3rem;
  font-weight: 400;
  color: #d87093;
  margin-bottom: 15px;
  min-height: 1.5em;
  transition: color 0.3s ease;
}

#result-message {
  font-size: 1.2rem;
  color: #5f676f;
  margin-bottom: 25px;
  white-space: pre-line;
}

.btn i {
  font-size: 1em;
}

.app-footer {
  width: 100%;
  margin-top: 30px;
  padding: 15px 0;
  text-align: center;
  font-size: 0.9rem;
  color: #8a9199;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.app-footer a {
  color: #777e85;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.app-footer a:hover {
  color: #d87093;
  text-decoration: underline;
}
