body {
    margin: 0;
    overflow: hidden;
    background-color: #222;
}

#game-container {
    width: 100vw;
    height: 100vh;
    background-color: #333;
    position: relative;
    overflow: hidden;
}

#player-ninja {
    position: absolute;
    width: 50px;
    height: 80px;
    background-color: #000; /* 黒い四角で忍者を表現 */
    left: 20px;
    bottom: 100px;
    z-index: 10;
}

.eye {
    position: absolute;
    width: 12px;  /* 少し大きく */
    height: 12px; /* 少し大きく */
    background-color: white;
    border-radius: 50%;
    top: 20px;
    /* position: relative; は不要。親の#player-ninjaが基準 */
}

.left-eye {
    left: 10px;
}

.right-eye {
    right: 10px;
}

.pupil {
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: black;
    border-radius: 50%;
    top: 50%;
    left: 70%;
    transform: translate(-50%, -50%);
}

.enemy .pupil {
    left: 30%; /* 敵の黒目は左寄りに */
}

#ninja-sword {
    display: none;
    position: absolute;
    width: 40px;
    height: 5px;
    background-color: white;
    top: 30px;
    left: 50px; /* 忍者の右側に表示 */
}

#player-ninja.attacking #ninja-sword {
    display: block;
}

.enemy {
    position: absolute;
    width: 50px;
    height: 80px;
    background-color: #c00;
    bottom: 100px;
    z-index: 9;
    
    animation-name: move-left;
    animation-duration: 5s;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.enemy-fast {
    background-color: #0077cc;
}

@keyframes move-left {
    from { right: -50px; }
    to { right: 100%; }
}

#score {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    font-size: 24px;
    font-weight: bold;
    z-index: 20;
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    user-select: none;
}

#lives-display {
    position: absolute;
    top: 10px;
    left: 10px;
    color: red;
    font-size: 24px;
    z-index: 20;
    user-select: none;
}

#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    font-size: 2em;
    z-index: 100;
}

#game-over-screen h2 {
    font-size: 2em;
    margin-bottom: 10px;
}

#game-over-screen p {
    font-size: 1.5em;
    margin-bottom: 20px;
}

#play-again-btn {
    padding: 15px 30px;
    font-size: 1.2em;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#play-again-btn:hover {
    background-color: #45a049;
}