@import url('https://fonts.googleapis.com/css?family=Raleway');

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  background: rgb(4, 36, 21);
  font-family: 'Raleway', sans-serif;
  padding: 10px;
}

.swal a {
  color: rgb(4, 36, 21);
  text-decoration: none;
  border-bottom: 1px solid #000;
}

.swal a:hover {
  font-weight: bold;
  border-bottom: 1px double #000;
}

#memory-game {
  width: 100%;
  max-width: 500px;
  height: auto;
  min-height: 80vh;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  perspective: 1000px;
  justify-content: center;
  align-items: flex-start;
}

.memory-card {
  width: calc(25% - 8px);
  height: calc(25% - 8px);
  min-height: 80px;
  margin: 4px;
  position: relative;
  box-shadow: 1px 1px 1px rgba(0,0,0,.3);
  transform: scale(1);
  transform-style: preserve-3d;
  transition: transform .5s;
}

.memory-card:active {
  transform: scale(0.97);
  transition: transform .2s;
}

.front-face,
.back-face {
  width: 100%;
  height: 100%;
  padding: 10px;
  position: absolute;
  border-radius: 5px;
  background: rgb(28, 204, 107);
  backface-visibility: hidden;
  object-fit: contain;
}

.memory-card.flip {
  transform: rotateY(180deg);
}

.front-face {
  transform: rotateY(180deg);
  background: #FFF;
}

.share-buttons {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.share-buttons button {
  padding: 12px 16px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  flex: 1;
  min-width: 80px;
  max-width: 120px;
}

.share-buttons button:nth-child(1) { background: #000; color: #fff; }
.share-buttons button:nth-child(2) { background: #0085ff; color: #fff; }
.share-buttons button:nth-child(3) { background: #000; color: #fff; }

/* Mobile-first responsive design */
@media (max-width: 768px) {
  #memory-game {
    width: 100vw;
    max-width: 100%;
    padding: 5px;
  }
  
  .memory-card {
    width: calc(33.333% - 10px);
    height: calc(25% - 10px);
    min-height: 70px;
    margin: 5px;
  }
  
  .front-face,
  .back-face {
    padding: 8px;
  }
  
  .share-buttons {
    gap: 6px;
  }
  
  .share-buttons button {
    padding: 10px 12px;
    font-size: 12px;
    min-width: 70px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 5px;
  }
  
  #memory-game {
    min-height: 70vh;
  }
  
  .memory-card {
    width: calc(50% - 10px);
    height: calc(20% - 10px);
    min-height: 60px;
    margin: 5px;
  }
  
  .front-face,
  .back-face {
    padding: 5px;
  }
  
  .share-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .share-buttons button {
    width: 100%;
    max-width: 200px;
    margin-bottom: 5px;
  }
}

@media (max-width: 320px) {
  .memory-card {
    width: calc(50% - 6px);
    height: calc(18% - 6px);
    min-height: 50px;
    margin: 3px;
  }
  
  .front-face,
  .back-face {
    padding: 3px;
  }
}