* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: fixed;
    touch-action: none;
}

body {
    margin: 0;
    padding: 0;
    background-image: url("candy-crush-background-2.png");
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: fixed;
    touch-action: none;
    -webkit-overflow-scrolling: none;
    overscroll-behavior: none;
}

.grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 90vw;
    max-width: 600px;
    aspect-ratio: 1 / 1;
    background-color: rgba(109, 127, 151, 0.5);
    padding: 5px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) inset, 0 1px 0 #fff;
    color: #85796b;
    gap: 2px;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.grid div {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

h3 {
 font-family: "Montserrat", sans-serif;
 text-transform: uppercase;
}

h1 {
 font-family: "Montserrat", sans-serif;
 text-transform: uppercase;
 margin-top: -10px;
}

.invisible {
    background-color: white;
}

.score-board {
  display: none;
}

@media (max-width: 400px) {
    .grid {
        max-width: 95vw;
        width: 95vw;
    }
    
    body {
        padding: 0;
        margin: 0;
        height: 100vh;
        width: 100vw;
        overflow: hidden;
        position: fixed;
    }
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.3s;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.game-title {
    font-family: "Montserrat", sans-serif;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
    font-size: 24px;
}

.score-display {
    font-family: "Montserrat", sans-serif;
    color: #fff;
    font-size: 20px;
    margin-bottom: 10px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}
