body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
    text-align: center;
}

#item-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    /*background: #FFF000;*/
}

.genre {
    margin-bottom: 20px;
    width: 100%;
}

.genre h2 {
    text-align: left;
    font-size: 24px;
    margin-bottom: 10px;
}

.item {
    position: relative;
    margin: 10px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #fff;
    height: 200px; /* 必要に応じて高さを調整 */
    width: 140px;
    vertical-align: top; /* 上揃え */
    display: inline-block;
}

.item img {
    width: 100px;
    height: 100px;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

/* 数値入力欄のスタイル */
.item input[type="number"] {
    width: 60px;
    text-align: center;
    position: absolute; /* 絶対配置で位置を固定 */
    bottom: 10px; /* アイテムの底に配置 */
    left: 50%; /* 水平中央に配置 */
    transform: translateX(-50%); /* 中央揃え */
    margin-top: 0; /* 余白をリセット */
}

/* 青色オーバーレイ（下に表示） */
.blue {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 255, 0.3); /* 青色で透明度30% */
    pointer-events: none; /* クリックを下の要素に通す */
    z-index: 1; /* 青色オーバーレイを一番下に表示 */
}

/* 黒色オーバーレイ（上に表示） */
.black {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 黒色で透明度50% */
    pointer-events: none; /* クリックを下の要素に通す */
    z-index: 3; /* 黒色オーバーレイを最上位に表示 */
}

/* 緑色オーバーレイ（下に表示） */
.green {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 255, 0, 0.3); /* 緑色で透明度30% */
    pointer-events: none; /* クリックを下の要素に通す */
    z-index: 2; /* 緑色オーバーレイを中間に表示 */
}

/* カバー（×印） */
.cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4; /* 最上位に表示 */
    pointer-events: none; /* クリックを妨げない */
}

.cover::before, .cover::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 5px; /* ここを太くする */
    background-color: red;
}

.cover::before {
    transform: rotate(45deg);
}

.cover::after {
    transform: rotate(-45deg);
}

input[type="number"] {
    width: 60px;
    text-align: center;
    white-space: normal; /* 自動的に改行する */
    overflow-wrap: break-word; /* 単語を途中で改行 */
    word-wrap: break-word; /* 古いブラウザ対応 */
    vertical-align: bottom; /* 上揃え */
    /*background:#FFFFFF;
    z-index: 3;*/
}

button {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 16px;
}

/* 使い方ボタン */
.how-to-use-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.how-to-use-btn:hover {
    background-color: #45a049;
}

/* モーダルの基本スタイル */
.modal {
    display: none; /* 初期状態では非表示 */
    position: fixed;
    z-index: 1001; /* ボタンの上に表示 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8); /* 背景を暗くする */
}

/* モーダルコンテンツ */
.modal-content {
    position: relative;
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
}

/* 閉じるボタン */
.close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* スマートフォン向けのメディアクエリ */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    #item-container {
        flex-direction: column;
        align-items: center;
    }

    .item {
        width: 100px;  /* 幅を縮小 */
        height: 150px; /* 高さを調整 */
    }

    .item img {
        width: 80px;
        height: 80px;
    }

    /* ボタンサイズの調整 */
    button {
        padding: 8px 16px;
        font-size: 14px;
    }

    /* モーダルの調整 */
    .modal-content {
        width: 90%;
        padding: 10px;
    }
}

