@charset "UTF-8";

*, *::before, *::after {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
:root {
    --main-color: #000;
    --sub-color: #f7de05;
    --accent-color: #b67b03;
    --text-color: #fff;
}
html {
    font-size: 100%;
}
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    min-height: 100svh;
    overflow: hidden;
}
body {
    background-color: var(--main-color);
}
.container {
    display: grid;
    grid-template-columns: 1fr minmax(0, 650px) 1fr; /*よこ 左右に均等な余白、中央は最大650pxで画面幅を超えない*/
    grid-template-rows: minmax(auto, 60px) minmax(auto, 520px) minmax(0, 30px); /*縦　上下はヘッダーフッター、真ん中はメイン*/
    grid-template-areas:
      "header header header"
      ". main ."
      "footer footer footer";
    width: 100%;
    height: 100svh;
    overflow: hidden;
    margin-top: 7px;
    row-gap: clamp(0.125rem, -22.538rem + 26.09vw, 1.25rem);
    align-content: center;
}
img {
    display: block;
    line-height: 0;
    border: none;
    outline: none;
    box-shadow: none;
}
a {
    display: block;
    margin: 0;
    padding: 0;
}
header {
    grid-area: header;
    text-align: center;
}
    h1 {
        background: -webkit-linear-gradient(-90deg, #F7DE05, #DA8E00, #EDAC06, #F7DE05, #ECB802, #DAAF08, #B67B03, #DA8E00, #EDAC06, #F7DE05, #ECB802, #EDAC06);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        font-size: 1.4rem;
        font-family: "WDXL Lubrifont JP N", sans-serif;
        font-weight: 600;
        font-style: normal;
    }
    h2 {
        background: -webkit-linear-gradient(-90deg, red 60%, white 90%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        font-size: 1.1rem;
        font-family: "WDXL Lubrifont JP N", sans-serif;
        font-weight: 700;
        font-style: normal;
        padding-top: 0.6%;
    }

.main-wrapper {
    grid-area: main;
    position: relative;
    border: 20px solid grey;
    width: 100%;
    height: 520px;
    object-fit: contain;
}
    .monster-wrapper {
        position: absolute;
        top: 0;
        left: 50%; /*中央寄せ*/
        transform: translateX(-50%); /*中央寄せ*/
        width: 100%;
        height: 460px;
        background-color: #8EB8FF;
    }
        .forest {
            z-index: 50;
            position: absolute;
            top: 55px;
            left: 50%; /*中央寄せ*/
            transform: translateX(-50%); /*中央寄せ*/
            width: 100%;
            height: 45%;
            object-fit: cover;
        }
        .cloud {
            z-index: 2;
            position: absolute;
            top: -10px;
            right: 0px;
            width: 500px;
            height: 155px;
            max-width: 100%;
            background-image: url('../images/bg-cloud-750.png');
            background-size: cover;
            animation: cloudMove 5.2s steps(3) infinite;
        }
        @keyframes cloudMove {
            to {
                background-position: 1498px 0;
            }
        }

        #slimeMonster {
            z-index: 500;
            position: absolute;
            top: 120px;
            left: 50%; /*中央寄せ*/
            transform: translateX(-50%); /*中央寄せ*/
            max-width: 100%;
            width: 150px;
            height: 150px;
            background-size: cover;
            opacity: 1;
            animation: parapara 1.5s steps(2) infinite;
            transition: opacity 1.5s ease-out;
        }
        @keyframes parapara {
            to {
                background-position-x: 300px;
            }
        }
        .red-slime {
            background-image: url('../images/anime-slime-red-450.png');
        }
        .aqua-slime {
            background-image: url('../images/anime-slime-450.png');
        }

.fade-out {
    opacity: 0 !important;
}

        #drop-display {
            z-index: 998;
            position: absolute;
            top: 105px;
            left: 50%; /*中央寄せ*/
            transform: translateX(-50%); /*中央寄せ*/
            align-items: center;
            justify-content: center;
            width: clamp(11.063rem, 1.761rem + 67.96vw, 18.75rem);
            height: 170px;
            margin: 0 auto;
            border: 6px solid var(--accent-color);
            border-radius: 10px;
            background-color: var(--sub-color);
        }
            #shine {
                z-index: 999;
                position: absolute;
                top: 105px;
                left: 50%; /*中央寄せ*/
                transform: translateX(-50%); /*中央寄せ*/
                align-items: center;
                justify-content: center;
                width: clamp(11.063rem, 1.761rem + 67.96vw, 18.75rem);
                height: 170px;
                margin: 0 auto;
                border: 6px solid var(--accent-color);
                border-radius: 10px;
                background: linear-gradient(
                    -45deg,
                    rgba(255, 255, 255, 0) 0%,
                    rgba(255, 255, 255, 1) 50%,
                    rgba(255, 255, 255, 0) 100%
                );
                opacity: 0;
                pointer-events: none;
                animation: shineRotation 2.9s ease-in-out 1;
            }
            @keyframes shineRotation {
                0% {
                    opacity: 0;
                }
                10% {
                    opacity: 1;
                }
                100% {
                    opacity: 0;
                }
            }
            .item-image {
                width: 80px;
                height: 80px;
                border: 3px solid var(--accent-color);
                border-radius: 5px;
                margin: 15px 10px;

            }
            .item-name {
                font-family: "WDXL Lubrifont JP N", sans-serif;
                font-weight: 400;
                font-style: normal;
                font-size: 0.95rem;
                width: 100px;
                text-align: center;
                color: var(--accent-color);
            }


        .grass {
            z-index: 450;
            position: absolute;
            bottom: -21px;
            left: 50%; /*中央寄せ*/
            transform: translateX(-50%); /*中央寄せ*/
            width: 100%;
            height: 395px;
            overflow: hidden;
            background-image: url('../images/bg-grass.png');
            object-fit: contain;
        }


    #attackButton {
        z-index: 550;
        position: absolute;
        top: 285px;
        left: 50%; /*中央寄せ*/
        transform: translateX(-50%); /*中央寄せ*/
        width: 150px;
        height: 45px;
        outline: 4px solid #fff;
        outline-offset: -7px; /*負の値を指定して内側へ線をつける*/
        border-radius: 5px;
        background-color: var(--main-color);
        color: var(--text-color);
        font-size: 1.2rem;
        font-family: "WDXL Lubrifont JP N", sans-serif;
        font-weight: 400;
        font-style: normal;
        line-height: 1.3rem;
        cursor: pointer;
    }
    .text-display {
        z-index: 550;
        position: absolute;
        top: 318px;
        left: 50%; /*中央寄せ*/
        transform: translateX(-50%); /*中央寄せ*/
        width: 350px;
        height: 140px;
        margin: 15px auto;
        outline: 4px solid #fff;
        outline-offset: -7px; /*負の値を指定して内側へ線をつける*/
        border-radius: 5px;
        color: var(--text-color);
        background-color: var(--main-color);
        font-size: 1.2rem;
        line-height: 25px;
        white-space: pre-wrap;
        font-family: "WDXL Lubrifont JP N", sans-serif;
        font-weight: 400;
        font-style: normal;
    }
        #addText {
            position: absolute;
            top: 15px;
            left: 30px;
            color: var(--text-color);
        }
        #textPlayer {
            position: absolute;
            top: 73px;
            left: 30px;
            color: var(--text-color);
        }


        #hitPoint {
            z-index: 501;
            position: absolute;
            top: 77px;
            left: 50%; /*中央寄せ*/
            transform: translate(-50%, -50%);
            color: var(--text-color);
            font-size: clamp(2.5rem, -1.096rem + 13.58vw, 3.2rem);
            font-family: "VT323", monospace;
            font-weight: 400;
            font-style: normal;
        }
    #playerPoint {
        z-index: 460;
        position: absolute;
        top: 283px;
        right: 10px;
        color: var(--text-color);
        font-size: clamp(1.36rem, -1.55rem + 12.25vw, 2.7rem);
        font-family: "VT323", monospace;
        font-weight: 400;
        font-style: normal;
    }
            .blue {
                background: -webkit-linear-gradient(-90deg, cyan, white);
                -webkit-background-clip: text;
                background-clip: text;
                -webkit-text-fill-color: transparent;
            }
            .red {
                background: -webkit-linear-gradient(-90deg, red, white);
                -webkit-background-clip: text;
                background-clip: text;
                -webkit-text-fill-color: transparent;
            }
            .green {
                background: -webkit-linear-gradient(-90deg, lime, white);
                -webkit-background-clip: text;
                background-clip: text;
                -webkit-text-fill-color: transparent;
                margin-top: -7px;
                transition: margin-top 0.8s;
            }

footer {
    grid-area: footer;
    padding-bottom: 5px;
    text-align: center;
    color: var(--text-color);
    font-size: 1.0rem;
    font-family: "VT323", monospace;
    font-weight: 400;
    font-style: normal;
}


.attack-effect {
    z-index: 555;
    position: absolute;
    width: 180px;
    height: 38px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.7) 0%, rgba(255, 0, 0, 0.4) 100%);
    clip-path: polygon(
        50% 0%, 58% 38%, 90% 20%, 72% 50%, 100% 70%, 65% 75%, 70% 100%, 50% 80%,
        30% 100%, 35% 75%, 0% 70%, 28% 50%, 10% 20%, 42% 38%
    );
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    animation: attack-btn 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes attack-btn {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}


@media screen and (max-width: 400px) {
    .container {
        gap: 0;
        grid-template-rows: 50px auto auto;
        margin: 0;
    }

    h1 {
        font-size: 1.05rem;
    }
    h2 {
        font-size: 0.98rem;
    }

    .main-wrapper {
        height: 470px;
    }
        .monster-wrapper {
            height: 100%;
        }
        #slimeMonster {
            top: 100px;
            width: 120px;
            height: 120px;
        }
        @keyframes parapara {
            to {
                background-position-x: 240px;
            }
        }


    #drop-display {
        top: 75px;
    }
    #shine {
        top: 75px;
    }

        .item-image {
            width: 60px;
            height: 60px;
            border: 2px solid var(--accent-color);
            border-radius: 5px;
            margin: 15px auto;
        }
        .item-name {
            font-size: 0.8rem;
        }

    .grass {
        bottom: 0;
        height: 350px;
    }


    #attackButton {
        top: 258px;
        width: 110px;
        height: 35px;
        outline: 3px solid #fff;
        outline-offset: -6px;
        font-size: 0.8rem;
        line-height: 1.3rem;
    }
    .text-display {
        width: clamp(11.188rem, 4.306rem + 50.28vw, 16.875rem);
        height: 100px;
        margin: 5px auto;
        outline: 3px solid #fff;
        outline-offset: -6px;
        font-size: 0.9rem;
        line-height: 17px;
    }
        #addText {
            top: 12px;
            left: 10px;
        }
        #textPlayer {
            top: 53px;
            left: 10px;
        }


        #hitPoint {
            top: 67px;
        }
    #playerPoint {
        top: 293px;
        right: 7px;
    }

    footer p {
        padding-top: 5px;
    }

    .attack-effect {
        width: 140px;
    }
}