body {
  background-image: url("images/background_img.jpg"); 
  width: 100vw;
  height: 100vh;
  margin: 0;
  background-size: cover; /* cover whole screen */
  background-repeat: no-repeat;
  font-family: 'Fredoka', sans-serif;
  text-align: center;
}
.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
#myH1 {
    font-size: 3rem;
    display: inline-block;
    background-color: #FEDA4A;
    color: #1E4F91;
    border: 0.5rem ridge #1E4F91;
    border-radius: 5rem;
    padding: 1rem;
}
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999; /* Make sure it’s on top of all other content */
}
#overlayText {
    font-size: 10rem;
    color: white;
    font-weight: bold;
    animation: heartbeat 1.5s infinite;
    text-shadow:
        -2px -2px 0 black,
        0   -2px 0 black,
        2px -2px 0 black,
        2px  0   0 black,
        2px  2px 0 black,
        0    2px 0 black,
        -2px  2px 0 black,
        -2px  0   0 black;
    
}
#grid {
    display: grid;
    grid-template-columns: repeat(4, 200px);
    gap:10px;
}
#grid img {
    width: 200px;
    height: 200px;
    box-sizing: border-box;
    border: 0.2rem solid black;
    border-radius: 1rem;
    object-fit: cover; /* cover whole image */
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
}
#grid img.flip {
    animation: flipCard ease-out 0.5s forwards;
}
.hidden {
  display:none;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.3); }
  28% { transform: scale(1); }
  42% { transform: scale(1.3); }
  70% { transform: scale(1); }
}
@keyframes flipCard {
  0%   { transform: rotateY(0deg); }
  50%  { transform: rotateY(90deg); }
  51%  { transform: rotateY(90deg); }
  100% { transform: rotateY(180deg); }
}
@media (max-width: 830px) { 
  html {
    font-size: 12px;
  }
  #grid {
    gap: 0;
  }
}

/* Mobile portrait */
@media (max-width: 830px) { 
  #myH1 {
    font-size: 2rem;
  }
  #grid {
    grid-template-columns: repeat(4, 25vw);
    gap: 0;
  }
  #grid img {
    width: 25vw;
    height: 25vw;
  }
}

/* Mobile landscape */
@media (max-width: 830px) and (orientation: landscape) {
  #myH1 {
    font-size: 1rem;
  }
  #grid {
    grid-template-columns: repeat(4, 20vh);
  }
  #grid img {
    width: 20vh;
    height: 20vh;
  }
}