/* ===== Memory card CSS ===== */

#startScreen{
  max-width: 420px;
  margin: 80px auto;
  padding: 32px 26px;
  background: linear-gradient(135deg, #fde2f3, #f9a8d4);
  border-radius: 26px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.22);
}



.memory-layout{
  display: flex;
  gap: 16px;
}

.memory-collected{
  width: 90px;
  min-height: 140px;
  background: linear-gradient(135deg, #fde68a, #fef3c7);
  border-radius: 24px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.6),
              0 10px 24px rgba(0,0,0,0.12);
}


.collected-pair{
  background: #bbf7d0;
  border-radius: 18px;
  padding: 8px;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 6px 14px rgba(22,163,74,0.25);
}

.memory-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
  padding: 6px;
  width: 100%;
}


.memory-card{
  height: 100px;
  border-radius: 26px;
  background: linear-gradient(135deg, #f9a8d4, #c4b5fd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
  color: #111827;
  box-shadow: 0 10px 22px rgba(0,0,0,0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.memory-card:hover{
  transform: scale(1.06) rotate(-1deg);
}

.memory-card:active{
  transform: scale(0.98);
}

.memory-card.hidden{
  background: #e5e7eb;
  color: transparent;
}

.memory-card.open{
  background: linear-gradient(135deg, #ffffff, #fde2f3);
  box-shadow: 0 14px 30px rgba(255,105,180,0.35);
  transform: scale(1.08);
}

.memory-card.success{
  background: #bbf7d0;
  box-shadow: 0 14px 30px rgba(22,163,74,0.25);
  color: #111827;
}

.memory-card.taken{
  opacity: 0;
  pointer-events: none;
}


.memory-toast{
  margin-top: 16px;
  font-size: 20px;
  font-weight: 900;
  color: #16a34a;
}




.global-star{
  position: fixed;
  font-size: 48px;
  color: #ff4fd8;
  pointer-events: none;
  z-index: 9999;
  animation: starFly 2.8s ease-out forwards;
  text-shadow: 0 6px 0 rgba(0,0,0,0.15);
  filter: saturate(1.6);
}

@keyframes starFly{
  0%{
    transform: scale(0.2) translate(0, 0) rotate(0deg);
    opacity: 0;
    filter: hue-rotate(0deg);
  }

  15%{
    opacity: 1;
    transform: scale(1) translate(0, -20px) rotate(45deg);
  }

  40%{
    transform: scale(1.4) translate(30px, -120px) rotate(180deg);
    filter: hue-rotate(120deg);
  }

  70%{
    transform: scale(1.2) translate(-40px, -200px) rotate(300deg);
    filter: hue-rotate(220deg);
    opacity: 1;
  }

  100%{
    transform: scale(0.9) translate(20px, -280px) rotate(360deg);
    filter: hue-rotate(300deg);
    opacity: 0;
  }
}

.sound-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fbcfe8;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  color: #831843;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(236,72,153,0.25);
  margin: 6px auto 14px;
}

.sound-pill input{
  width: 18px;
  height: 18px;
  accent-color: #ec4899;
  cursor: pointer;
}











@media (max-width: 520px){

  .memory-layout{
    flex-direction: column;
    align-items: center;
  }

  .memory-grid{
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    order: 1;
  }

  .memory-collected{
    width: 100%;
    max-width: 320px;
    order: 2;
  }

  .memory-card{
    height: 92px;
    font-size: 22px;
  }

  .memory-card.open{
    transform: none;
  }

  .memory-card:hover{
    transform: none;
  }
}
.memory-card{
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.memory-card{
  font-size: 18px;
  line-height: 1.1;
}
.memory-card{
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: normal;
  font-size: clamp(13px, 4vw, 18px);
  line-height: 1.25;
  text-align: center;
}
