body { background-color: #000; color: #fff; font-family: sans-serif; } .board { display: flex; flex-direction: row; justify-content: center; align-items: center; } .square { width: 100px; height: 100px; margin: 10px; background-color: #fff; color: #000; font-size: 50px; text-align: center; cursor: pointer; } .square:hover { background-color: #ccc; } .square.active { background-color: #000; color: #fff; } .winner { background-color: #f00; color: #fff; }