<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Rock Paper Scissors</title>
    <script src="/socket.io/socket.io.js"></script>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f0f0f0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }
        .container {
            background-color: #ffffff;
            border-radius: 10px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            padding: 20px;
            text-align: center;
            width: 300px;
        }
        h1 {
            font-size: 24px;
            margin-bottom: 20px;
        }
        #messages {
            margin-bottom: 20px;
            font-size: 16px;
            color: #333333;
        }
        button {
            background-color: #007bff;
            color: #ffffff;
            border: none;
            border-radius: 5px;
            padding: 10px 20px;
            margin: 5px;
            cursor: pointer;
            font-size: 16px;
        }
        button:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>DAŞ KAĞIT MAKAS oyunu</h1>
        <div id="messages">Bağlanılıyor...</div>
        <button onclick="sendMove('rock')">DAŞ</button>
        <button onclick="sendMove('paper')">Kağıt</button>
        <button onclick="sendMove('scissors')">Makas</button>
    </div>

    <script>
        const socket = io();

        socket.on('message', (message) => {
            document.getElementById('messages').innerText = message;
        });

        socket.on('result', (result) => {
            document.getElementById('messages').innerText = result;
        });

        function sendMove(move) {
            socket.emit('move', move);
        }
    </script>
</body>
</html>