@media (max-width: 1050px) {
  /* lessonクラスのCSSを指定してください */

#illust2 {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 5rem;
    width: 51%;
}

#illust2 .waku {
    margin-top: -8rem;
    margin-left: 27vw;
    max-width: 48vw;
}

#score-display {
    position: absolute;
    top: 0px;
    left: -5px;
    /* right: 15px; */
    z-index: 50;
    color: #ffd700;
    font-size: 1.4em;
    font-weight: bold;
    text-shadow: 0 0 5px #ffcc00;
    background-color: transparent;
}

#game-time-display {
    position: absolute;
    top: 0px;
    right: -5px;
    z-index: 50;
    color: #ffd700;
    font-size: 1.4em;
    font-weight: bold;
    text-shadow: 0 0 5px #ffcc00;
}

.text-group {
    position: absolute;
    top: 25%;
    left: 76%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: 40vw;
}

#ep1{
    position: absolute;
margin-top:-4rem;
}

#answer1-1 {
    position: absolute;
    top: 50%;
    left: 71%;
    transform: translate(-50%, -50%);
    font-size: 4vw;
}

#answer1_2 {
    position: absolute;
    top: 35%;
    left: 88%;
    transform: translate(-50%, -50%);
    width: 5vw;
    height: 5vw;
    font-size: 4vw;
    text-align: center;
}

#answer1_3 {
    position: absolute;
    top: 52%;
    left: 88%;
    transform: translate(-50%, -50%);
    width: 7vw;
    height: 0.3vw;
    font-size: 4vw;
    text-align: center;
}


#answer1 {
    position: absolute;
    top: 68%;
    left: 88%;
    transform: translate(-50%, -50%);
    width: 5vw;
    height: 5vw;
    font-size: 4vw;
    text-align: center;
}

#answer1_4 {
    position: absolute;
    top: 70%;
    left: 107%;
    transform: translate(-50%, -50%);
    width: 6vw;
    height: 6vw;
    font-size: 4vw;
    text-align: center;
}

#answer1_5 {
    position: absolute;
    top: 51%;
    left: 75%;
    transform: translate(-50%, -50%);
    width: 4vw;
    height: 0.5vw;
    font-size: 4vw;
    text-align: center;
}

#answer1_6 {
    position: absolute;
    top: 30%;
    left: 107%;
    transform: translate(-50%, -50%);
    width: 6vw;
    height: 6vw;
    font-size: 4vw;
    text-align: center;
}


#nextpizza {
    position: absolute;
    width: 20vw;
    height: auto;
    top: -22rem;
    left: 25vw;
    z-Index: 5;
}

#modal {
    top: -60%;
    width: 55%;
    height: 23%;
    margin: auto;
    background-color: rgba(255, 255, 255);
    border-radius: 6px;
    padding: 0;
    outline: 2px dashed #be8f68;
    outline-offset: -10px;
}

#movableKeypad {
        /* 幅をPCの時より小さくする（例：300pxから240pxへ） */
        width: 240px; 
        
        /* 高さを自動にし、ボタンサイズに合わせて伸縮させる */
        height: auto; 
    }

#result-modal {
    position: fixed;
    top: -22vh;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999; /* 最前面に表示 */
    /* ... その他の設定 ... */
}


}

@media (orientation: landscape) and (max-width: 1050px){
  /* .lessonのwidthを100%に指定してください */

#illust1 {
    width: 110%;
    height: 16rem;
}

#illust2 {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: -3rem;
    width: 51%;
}

#nextpizza {
    position: absolute;
    width: 20vw;
    height: auto;
    top: -15rem;
    left: 25vw;
    z-Index: 5;
}

#answer1 {
    position: absolute;
    top: 8.5rem;
    left: 88%;
    transform: translate(-50%, -50%);
    width: 5vw;
    height: 5vw;
    font-size: 4vw;
    text-align: center;
}

#answer1-1 {
    position: absolute;
    top: 6.2rem;
    left: 71%;
    transform: translate(-50%, -50%);
    font-size: 4vw;
}

.text-group {
    position: absolute;
    top: -10%;
    left: 76%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: 40vw;
}

#ep1{
    position: absolute;
margin-top:5%;
}

#pizza {
    width: 100px;
    height: auto;
    position: absolute;
    top: 7.5rem;
    left: -20px;
}

#illust2 .questtion1-1 {
    margin-top: 20%;
    font-size: 4vw;
    text-align: center;
    z-Index: 3;
}

#modal {
    top: 0%;
    width: 55%;
    height: 70%;
    margin: auto;
    background-color: rgba(255, 255, 255);
    border-radius: 6px;
    padding: 0;
    outline: 2px dashed #be8f68;
    outline-offset: -10px;
}

/* ------------------------------------ */
    /* A. 外側のネオンリング (.neon-frame-outer) のサイズ調整 */
    /* ------------------------------------ */
    .neon-frame-outer {
        /* ★★★ 修正: 縦幅が狭い横画面に合わせて大幅に縮小 ★★★ */
        width: 250px;  /* 例: 300px → 250px にさらに縮小 */
        height: 250px; /* 例: 300px → 250px にさらに縮小 */
        padding: 10px;
    }

    /* ------------------------------------ */
    /* B. 内側のネオンリング (.neon-frame-inner) のサイズ調整 */
    /* ------------------------------------ */
    .neon-frame-inner {
        width: 230px; 
        height: 230px; 
        padding: 10px; 
    }
    
    /* ------------------------------------ */
    /* C. スコアとテキストのフォントサイズ調整 */
    /* ------------------------------------ */
    .final-score-value {
        /* スコアの文字サイズをさらに縮小 */
        font-size: 2.5em; 
    }

    .result-message, .result-message-sub {
        /* メッセージの文字サイズをさらに縮小 */
        font-size: 0.3em; 
        margin: 1px 0; /* マージンも最小限に */
    }

    .modal-content button {
        /* ボタンのサイズも縮小 */
        padding: 6px 15px;
        font-size: 0.9em;
    }
    
    /* ------------------------------------ */
    /* D. モーダルコンテンツの上下の位置調整 */
    /* ------------------------------------ */
#result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999; /* 最前面に表示 */
        align-items: center; 
        padding: 0;
}




}



@media (max-width: 430px) {
  /* lessonクラスのCSSを指定してください */

#illust1 {
    width: 110%;
    height: 12rem;
}

#score-display {
    position: absolute;
    top: 0px;
    left: -5px;
    /* right: 15px; */
    z-index: 50;
    color: #ffd700;
    font-size: 0.7em;
    font-weight: bold;
    text-shadow: 0 0 5px #ffcc00;
    background-color: transparent;
}

#game-time-display {
    position: absolute;
    top: 0px;
    right: -5px;
    z-index: 50;
    color: #ffd700;
    font-size: 0.7em;
    font-weight: bold;
    text-shadow: 0 0 5px #ffcc00;
}



#illust2 .waku {
    margin-top: -20rem;
    margin-left: 27vw;
    max-width: 48vw;
}

#pizza {
    width: 10vw;
    height: auto;
    position: absolute;
    top: 10rem;
    left: -2vw;
}

.text-group {
    position: absolute;
    top: -100%;
    left: 77%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: 40vw;
}

#ep1{
    position: absolute;
margin-top:-10rem;
}


#nextpizza {
    position: absolute;
    width: 20vw;
    height: auto;
    top: -22rem;
    left: 25vw;
    z-Index: 5;
}

#answer1_2 {
    position: absolute;
    top: -7.5rem;
    left:90%;
    transform: translate(-50%, -50%);
    width: 5vw;
    height: 5vw;
    font-size: 4vw;
    text-align: center;
}

#answer1 {
    position: absolute;
    top: -5.3rem;
    left: 90%;
    transform: translate(-50%, -50%);
    width: 5vw;
    height: 5vw;
    font-size: 4vw;
    text-align: center;
}

#answer1-1 {
    position: absolute;
    top: -6.5rem;
    left: 71%;
    transform: translate(-50%, -50%);
    font-size: 4vw;
}

#answer1_3 {
    position: absolute;
    top: -6.4rem;
    left: 90%;
    transform: translate(-50%, -50%);
    width: 7vw;
    height: 0.3vw;
    font-size: 4vw;
    text-align: center;
}

#answer1_5 {
    position: absolute;
    top: -6.5rem;
    left: 75%;
    transform: translate(-50%, -50%);
    width: 4vw;
    height: 0.5vw;
    font-size: 4vw;
    text-align: center;
}

#answer1_6 {
    position: absolute;
    top:-8.2rem;
    left: 110%;
    transform: translate(-50%, -50%);
    width: 6vw;
    height: 6vw;
    font-size: 4vw;
    text-align: center;
}

#answer1_4 {
    position: absolute;
    top:-5.8rem;
    left: 110%;
    transform: translate(-50%, -50%);
    width: 6vw;
    height: 6vw;
    font-size: 4vw;
    text-align: center;
}


#illust2 .questtion1-1 {
    margin-top: -11.5rem;
    font-size: 4vw;
    text-align: center;
    z-Index: 3;
}


#modal p.kekka0 {
    position: absolute;
    top: 10%;
    left: 5%;
    right: 5%;
    font-size: 100%;
    text-align: center;
    font-family: "Nikukyu";
    color: black;
    font-weight: bold;
}

#modal {
    top: -60%;
    width: 55%;
    height: 18%;
    margin: auto;
    background-color: rgba(255, 255, 255);
    border-radius: 6px;
    padding: 0;
    outline: 2px dashed #be8f68;
    outline-offset: -10px;
}

/* ------------------------------------ */
    /* A. 外側のネオンリング (.neon-frame-outer) のサイズ調整 */
    /* ------------------------------------ */
    .neon-frame-outer {
        /* ★★★ 修正: 円形フレームのサイズを縮小 ★★★ */
        width: 300px;  /* 例: 元の450px → 300px に縮小 */
        height: 300px; /* 例: 元の450px → 300px に縮小 */
        
        /* padding や box-shadow の値も縮小に合わせて微調整しても良い */
        padding: 15px;
    }

    /* ------------------------------------ */
    /* B. 内側のネオンリング (.neon-frame-inner) のサイズ調整 */
    /* ------------------------------------ */
    .neon-frame-inner {
        /* 外側のフレームに合わせてサイズを調整 */
        width: 270px; /* 元の400px → 270px */
        height: 270px; /* 元の400px → 270px */
        
        /* padding: 30px; */ /* padding: 30px; のままだと内側が狭くなる可能性あり */
        padding: 15px; /* 例: パディングも縮小 */
    }

    /* ------------------------------------ */
    /* C. スコアとテキストのフォントサイズ調整 */
    /* ------------------------------------ */
    .final-score-value {
        /* スコアの文字サイズを縮小 */
        font-size: 3em; /* 元の5em → 3em 程度に */
    }

    .result-message, .result-message-sub {
        /* メッセージの文字サイズを縮小 */
        font-size: 0.8em; /* 元の1.2em → 1em 程度に */
    }

    .modal-content button {
        /* ボタンのパディングも少し小さく */
        padding: 8px 18px;
        font-size: 1em;
    }

}