body {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f0f0f0;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
}

h1 {
    color: #333;
    margin-bottom: 20px;
}

.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.player-form {
    width: 100%;
    max-width: 400px;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 20px;
}

.player-form h2 {
    color: #333;
    margin-bottom: 15px;
}

.player-form input {
    width: 80%;
    max-width: 300px;
    display: block;
    margin: 0 auto 15px auto;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.player-form input:focus {
    border-color: #4CAF50;
    outline: none;
}

.player-form button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.player-form button:hover {
    background-color: #45a049;
}

.main-content {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
}

.game-container {
    position: relative;
}

canvas {
    border: 2px solid #333;
    border-radius: 5px;
}

button {
    background-color: #008000;
    color: #ffffff;
    font-size: 24px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
}

button:hover {
    background-color: #005700;
}

.score {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 24px;
    color: #333;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 5px 10px;
    border-radius: 5px;
}

#scoreDisplay {
    font-weight: bold;
    color: #0000ff;
}

.start-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 24px;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.hidden {
    display: none;
}

.ranking-container {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    min-width: 250px;
    max-height: 400px;
    overflow-y: auto;
}

.ranking-container h2 {
    margin-top: 0;
    color: #333;
    font-size: 20px;
    text-align: center;
}

#rankingList {
    margin-top: 10px;
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.ranking-item:hover {
    background-color: #f9f9f9;
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-position {
    font-weight: bold;
    color: #333;
}

.ranking-score {
    color: #4CAF50;
    font-weight: bold;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

@media (max-width: 1100px) {
    .main-content {
        flex-direction: column;
        align-items: center;
    }

    .ranking-container {
        width: 100%;
        max-width: 800px;
    }
}

@media (max-width: 900px) {
    .game-container {
        width: 100vw;
        max-width: 100vw;
        overflow-x: auto;
    }

    canvas {
        width: 100% !important;
        max-width: 100vw;
        height: auto;
    }
}

@media (max-width: 600px) {
    .player-form {
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 10px;
    }

    .game-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .game-container {
        width: 100%;
        min-width: unset;
    }

    .ranking-container {
        width: 100%;
        margin-top: 10px;
    }

    .score {
        position: static;
        display: block;
        text-align: center;
        margin-top: 10px;
    }

    .start-message {
        position: static;
        transform: none;
        margin: 10px 0;
    }
}