html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: 'Montserrat', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f0f0f0;
  min-height: var(--app-height, 100vh);
  padding: calc(env(safe-area-inset-top) + 1rem) clamp(1rem, 4vw, 2rem) calc(env(safe-area-inset-bottom) + 1rem);
  box-sizing: border-box;
}

#game-container {
  text-align: center;
  width: 100%;
  max-width: 420px;
  padding: 1rem;
  box-sizing: border-box;
}

#rules {
  font-size: clamp(0.6rem, 2vw, 0.8rem);
  margin: 0 0 10px;
}

#controls {
  margin-bottom: 10px;
}

#mode {
  margin-left: 5px;
}

#board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 0.5vmin;
  width: min(90vmin, 420px);
  aspect-ratio: 7 / 6;
  background-color: #005bbb;
  padding: 0.5vmin;
  border-radius: 10px;
  margin: 0 auto;
  box-sizing: border-box;
  position: relative;
}

.cell {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: white;
  cursor: pointer;
  position: relative;
}

.cell.red::after,
.cell.yellow::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: -700%;
  border-radius: 50%;
  animation: drop 0.3s ease-out forwards;
  pointer-events: none;
}

.cell.red::after {
  background-color: red;
}

.cell.yellow::after {
  background-color: yellow;
}

@keyframes drop {
  to {
    top: 0;
  }
}

#message {
  margin-top: 10px;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}

#reset {
  margin-top: 10px;
  padding: 5px 10px;
}

