/* ゲームページのスタイル設定 */
body {
    display: flex;
    width: 100%;
    margin: auto;
    font-family: sans-serif;
}

/* サイドブロックのスタイル */
#sidebar {
    width: 260px;
//    height: 760px;
    background-color: #E6FFE9;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
    background-image: url(../image/s_back1.png);
    background-size: cover;
}

/* ゲームタイトルロゴのスタイル */
#logo {
    font-size: 24px;
    font-weight: bold;
    position: absolute;
    margin-top: 20px;
    text-align: center;
}

.title_img {
    width: 200px;
    display: block;
}

.area_img {
    max-width:100px;
}


/* ピース画像配置エリア */
#pieces {
/*20260316　ipad対応のためflex関連の記述をコメントアウト*/
/*
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-end;
*/
    position: absolute;
    top: 30%;
/*20260316　ipad対応のため追記*/
    max-width:240px;
}

/* ピース画像のスタイル */
.piece {
    position: relative;
    object-fit: none;
    margin: 5px;
    cursor: grab;
    z-index: 601;
    touch-action:none;
/*20260316　ipad対応のため追記*/
    display:inline-block;
}

/* ボタン配置エリア */
#control {
   position: absolute;
   bottom: 12%;
}

#control img {
   margin: 0 10px;
}

#button {
   position: absolute;
   bottom: 5%;
}

#button img {
   width: 40%;
   margin: 0 10px;
}



/* メインブロックのスタイル */
#main {
    width: 85%;
    position: relative;
    overflow: auto;
    background-image: url(../image/back08.jpg);
    background-size: cover;
}

#main02 {
    width: 85%;
    position: relative;
    overflow: auto;
    background-image: url(../image/back09.jpg);
    background-size: cover;
}

/* 背景画像のスタイル */
.image-container {
   position: absolute;
   top: 10px;
   bottom: 0;
   left: 10px;
   right: 0;
   object-fit: none;
   width: 980px; /* 適切なサイズに調整 */
   height: 760px; /* 適切なサイズに調整 */
   overflow: hidden;
}
.image-container img {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   overflow: hidden;
}
.image-container .top-image {
   opacity: 0.1; /* 初期透過度 */
}

/* ドロップエリアのスタイル */
#drop-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 600;
}


/* スライダーのスタイル */
#slider {
    position: fixed;
    bottom: 5%;
    right: 5%;
    background-color: rgba(88, 88, 88, 0.4); 
}

.image-Slider {
   z-index: 1000;
}

/* コピーライトのスタイル */
.copyright {
   font-size: 14px;
   text-align: center;
   z-index: 1000;
}


/* ポップアップのスタイル */
[id^="popup-"] {
    position: absolute;
    background-color: #fff;
    border: 1px solid #000;
    border-radius: 10px;
    padding: 5px;
    font-size: 16px;
    z-index: 1000;
    justify-content: center;
}

ul {
  display: flex;
  justify-content: center;
}

li {
    list-style: none;
}


/* 正解表示のスタイル */
[id^="correct-"] {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    border: 2px solid #000;
    border-radius: 30px;
    padding: 20px;
    font-size: 20px;
    z-index: 1000;
}

[id^="correctclose-"] {
    position: fixed;
    top: 85%;
    left: 85%;

    background-color: #fff;
    border: 1px solid #000;
    border-radius: 5px;
    padding: 10px;
    font-size: 16px;
    z-index: 1001;
}

.pop_image {
    height: 200px;
    margin:10px;
    padding:10px;
}

#complete {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40%;
    background-color: #FFFFEE;
    border: 2px solid #000000;
    border-radius: 30px;
    padding: 20px;
    font-size: 24px;
    text-align: center;
    z-index: 1010;
}

/* 非表示クラス */
.hidden {
    display: none;
}


/* レスポンシブ対応 */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    #logo {
        flex-direction: column;
    }

    .title_img {
       max-width: 60%;
    }

    .area_img {
       position: absolute;
       top: 25%;
       margin-left: 10px;
       max-width: 60%;
    }


    #pieces {
/*20260316　ipad対応のためflex関連の記述をコメントアウト*/
/*
        flex-grow: 1;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-content: flex-end;
*/
        position: absolute;
        max-width:80%;
        top: 12%;
    }

    .piece {
       position: relative;
       object-fit: none;
       margin: 2px;
       cursor: grab;
       z-index: 601;
/*20260316　ipad対応のため追記*/
    max-width:100%;
    }


    #sidebar {
        width: 100%;
        height: 30%;
    }
    #main {
        width: 100%;
        height: 70%;
        overflow: auto;
    }
    #main02 {
        width: 100%;
        height: 70%;
        overflow: auto;
    }
    #drop-area {
        width: 100%;
        height: 760px;
    }

    ul {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    #control {
       position: absolute;
       top: 5%;
       right: 3%
    }

    #control img {
       margin: 0;
    }

    #button {
       position: absolute;
       top: 5%;
       left: 2%;
    }

    #button img {
       width: 35%;
       margin: 0 2px;
    }

    /* 正解表示のスタイル */
    [id^="correct-"] {
        position: fixed;
        top: 40%;
        left: 30%;
        height: 90%;
        transform: translate(-25%, -40%);
        background-color: #fff;
        border: 2px solid #000;
        border-radius: 25px;
        padding: 10px;
        font-size: 12px;
        z-index: 1000;
    }

    [id^="correctclose-"] {
        position: fixed;
        top: 87%;
        left: 70%;

        background-color: #fff;
        border: 1px solid #000;
        border-radius: 5px;
        padding: 10px;
        font-size: 16px;
        z-index: 1001;
    }

    .pop_image {
         width: 60%;
         height: auto;
         margin:5px;
         padding:5px;
    }

    #complete {
       position: fixed;
       top: 50%;
       left: 50%;
       transform: translate(-50%, -50%);
       width: 35%;
       background-color: #FFFFEE;
       border: 2px solid #000000;
       padding: 20px;
       font-size: 24px;
       text-align: center;
       z-index: 1010;
    }

}

/*スマホ時「完成」の画像が崩れないように追記*/
#complete img {
    max-width:100%;
}


/*低解像度のスマホ縦画面用に追記*/
@media (max-width: 400px) {

    #sidebar {
        height: 33%;
    }

    #logo {
        position: absolute;
        margin-top: 18px;
        text-align: center;
    }

    .title_img {
       max-width: 30%;
       margin-left: 27%;
    }

    .area_img {
       position: absolute;
       top: 25%;
       margin-left: 30px;
       max-width: 45px;
    }

    #pieces {
        position: absolute;
        max-width:95%;
        top: 10%;
    }

    #pieces img {
       margin: 0px;
    }

    #control {
       position: absolute;
       top: 5%;
       bottom: auto;
       text-align: right;
    }

    #control img {
       width: 35%;
    }

    #button {
       position: absolute;
       top: 4%;
       bottom: auto;
       left: 2%;
    }

    #button img {
       width: 25%;
       margin: 0 1px;
    }


    /* 正解表示のスタイル */
    [id^="correct-"] {
        position: fixed;
        top: 40%;
        left: 30%;
        height: 90%;
        transform: translate(-25%, -40%);
        background-color: #fff;
        border: 2px solid #000;
        border-radius: 25px;
        padding: 10px;
        font-size: 12px;
        z-index: 1000;
    }

    [id^="correctclose-"] {
        position: fixed;
        top: 87%;
        left: 70%;

        background-color: #fff;
        border: 1px solid #000;
        border-radius: 5px;
        padding: 10px;
        font-size: 16px;
        z-index: 1001;
    }

    .pop_image {
         width: 60%;
         height: auto;
         margin:5px;
         padding:5px;
    }

    #complete {
       position: fixed;
       top: 50%;
       left: 50%;
       transform: translate(-50%, -50%);
       width: 35%;
       background-color: #FFFFEE;
       border: 2px solid #000000;
       padding: 20px;
       font-size: 24px;
       text-align: center;
       z-index: 1010;
    }

}

/* スマホ横画面用に追記*/

@media (orientation: landscape) and (max-height: 450px) {
    body {
        display: flex;
        width: 100%;
        margin: auto;
        flex-direction: row;
    }

    #sidebar {
        width: 30%;
        height: auto;
        background-color: #E6FFE9;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 10px;
        }

    #logo {
        position: absolute;
        margin-top: 5px;
        text-align: center;
    }

    .title_img {
        max-width: 70px;
    }

    .area_img {
        max-width:40px;
        top: auto;
        margin-left: auto;
    }

    #pieces {
        top: 15%;
        width: 28%;
    }


    /* ボタン配置エリア */
    #control {
       position: absolute;
       top: auto;
       right: auto;
       bottom: 12%;
    }

    #control img {
       width: 30%;
       margin: 0 6px;
    }

    #button {
       position: absolute;
       top: auto;
       left: 2%;
       bottom: 5%;
    }

    #button img {
       width: 25%;
       margin: 0 5px;
    }

    #main {
        width: 85%;
        height: auto;        
        position: relative;
        overflow: auto;
    }

    #main02 {
        width: 85%;
        height: auto;
        position: relative;
        overflow: auto;
    }


    [id^="correct-"] {
        position: fixed;
        top: 10%;
        left: 10%;
        width: 80%;
        height: 78%;
        transform: translate(0%, 0%);
        padding: 5px;
        font-size: 8px;
    }

    [id^="correct-"] p {
        margin: 3px;
    }

    [id^="correctclose-"] {
        position: fixed;
        top: 80%;
        left: 88%;

        background-color: #fff;
        border: 1px solid #000;
        border-radius: 5px;
        padding: 5px;
        font-size: 12px;
        z-index: 1001;
    }

    .pop_image {
        max-height: 100px;
        margin: 0 5px;
    }

    ul {
        display: flex;
        flex-direction: row;
        justify-content: center;
    }

    li {
        list-style: none;
    }

}

