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

body {
  margin: 0;
  padding: 0;
  font-family: 'Quicksand', sans-serif;
  background: #ffe4ec;
  color: #4a0033;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s ease;
  box-sizing: border-box;
}

h1, h2, h3 {
  color: #c2185b;
  margin: 24px 0 16px;
  text-align: center;
  font-size: 2rem;
}

.btn {
  background: #ff8fa3;
  border: none;
  color: white;
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: all 0.25s ease;
  font-weight: bold;
  width: 180px;
  text-decoration: none; 
}

.btn:hover {
  background: #ff6b8a;
  transform: scale(1.04);
} 

.small-back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: #d63384;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  width: auto;
  text-decoration: none; 
}

.inside-game-back {
  z-index: 10;
}

.small-btn {
  width: 180px;
  font-size: 1rem;
  padding: 10px 18px;
}

.difficulty-container .button-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

.difficulty-container .button-group .btn {
  width: 200px;
  max-width: 100%;
  text-align: center;
}

.button-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin: 20px 0;
}

#gameContainer {
  display: flex;
  width: 100vw;
  height: 100vh;
  padding: 30px;
  box-sizing: border-box;
  gap: 20px;
}

#leftPanel {
  flex: 3;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fef7fa;
  padding: 20px;
  position: relative;
  border-radius: 20px;
  box-shadow: -2px 0 8px rgba(0,0,0,0.05);
  transition: background 0.3s ease;
}

body.player1-turn #leftPanel {
  background: #8d0062;
}

body.player2-turn #leftPanel {
  background: #4a0033;
}

#leftPanel .back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: #d63384;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 10px;
  box-shadow: none;
  z-index: 1;
  text-decoration: none;
}

#board {
  display: grid;
  gap: 12px;
  justify-content: center;
  align-content: center;
  grid-template-rows: repeat(auto-fill, 60px);
}

.card {
  width: 64px;
  height: 64px;
  font-size: 2rem;
  background: #ffdaed;
  border-radius: 12px;
  box-shadow: 0 1px 2px #d63384;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.card:hover {
  transform: scale(1.06);
}

.card.matched {
  background: #ffd1ec;
  box-shadow: 0 0 8px #ff66b2;
}

#rightPanel {
  flex: 1;
  background: #fef7fa;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  border-radius: 20px;
  box-shadow: -2px 0 8px rgba(0,0,0,0.05);
  gap: 18px;
}

#scoreboard, #gameStatus, #timer {
  font-size: 1.1rem;
  font-weight: bold;
  margin: 12px;
  padding: 10px 22px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  color: #7c004f;
}

#timer {
  background: #ffe6f3;
  border: 2px dashed #ffb6d9;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 208, 236, 0.92); 
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  font-family: 'Comic Sans MS', 'Poppins', sans-serif;
}

.modal-content {
  background: #fff0f6;
  border-radius: 30px 30px 20px 20px;
  padding: 20px 24px 30px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(255, 105, 180, 0.3);
  width: 250px;
  animation: popIn 0.3s ease;
  border: 4px solid #ffb3d1;
  position: relative;
  font-size: 16px;
}

@keyframes popIn {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header {
  background: #ff4fa8;
  color: white;
  font-size: 1.5rem;
  padding: 8px 0;
  border-radius: 20px 20px 0 0;
  margin: -24px -24px 16px;
  font-weight: bold;
}

.modal-btn {
  margin-top: 18px;
  padding: 10px 20px;
  background-color: #ff4fa8;
  border: none;
  border-radius: 12px;
  color: white;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.modal-btn:hover {
  background-color: #d63384;
}

.top-left-back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: #ff8fa3;
  color: white;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  text-decoration: none;
}

.top-left-back-btn:hover {
  background: #ff6b8a;
}

.card-panel {
  background: #fff0f7;
  padding: 40px 30px;
  border-radius: 24px;
  max-width: 350px;
  width: 90%;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  margin: 120px auto 0 auto;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.panel-title {
  font-size: 1.8rem;
  font-weight: bold;
  color: #c2185b;
  margin-bottom: 28px;
}

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

.modal-home-btn {
  background: #ff8fa3;
  color: white;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  text-decoration: none;
  margin: 20px auto 0; 
}
.modal-home-btn:hover {
  background: #ff6b8a;
}

.emoji-wallpaper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ffe4ec;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  grid-auto-rows: 40px;
  gap: 8px;
  padding: 0;
  margin: 0;
  z-index: 0;
  opacity: 0.15;
  pointer-events: none;
  overflow: hidden;
}

.emoji-wallpaper span {
  font-size: 1.8rem;
  user-select: none;
}

.retro-box {
  background: #fff;
  padding: 30px 25px; 
  border-radius: 22px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06); 
  max-width: 580px;
  width: 90%;
  margin: auto;
  position: relative;
}

.retro-inner-box {
  background: #ffe4ec; 
  padding: 36px 28px;
  border-radius: 18px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.04);
  max-width: 520px;
  margin: auto;
}

.retro-title {
  font-size: 3.2rem;
  font-family: 'Press Start 2P', cursive;
  color: #c2185b;
  margin-top: 0px;
  margin-bottom: 25px;
}

.retro-subtitle {
  font-family: 'Rubik', sans-serif;
  font-size: 1.3rem;
  color: #6a004f;
  font-weight: 600;
  margin-bottom: 10px;
}

.retro-tagline {
  font-family: 'Rubik', sans-serif;
  font-size: 1rem;
  color: #7a0055;
  margin-bottom: 30px;
}

.start-btn {
  background-color: #ff8fa3;
  color: white;
  padding: 12px 26px;
  border-radius: 30px;
  font-size: 1.1rem;
  font-weight: bold;
  border: none;
  text-decoration: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease; 
  display: inline-block;
}

.start-btn:hover {
  background-color: #ff6b8a;
  transform: scale(1.05);
}

@keyframes pop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
