/* 全体スタイル */
body {
    font-family: sans-serif;
    margin: 0;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden; /* ページ全体のスクロールを禁止し、mainのみスクロールさせる */
}

header {
    background-color: #add8e6; /* 水色に変更 */
    color: #333; /* 文字色を濃い色に変更して可読性を確保 */
    padding: 1em 20px;
    text-align: center;
    position: relative;
    z-index: 10;
}

header h1 {
    margin: 0;
}

.volume-control-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

#volume-slider {
    width: 150px;
    margin-left: 5px;
}

#click-counter-container {
    position: absolute;
    top: 15px;
    right: 20px;
    text-align: right;
    font-size: 0.85em;
    line-height: 1.4;
    color: #333; /* 文字色を濃い色に変更 */
}

#click-counter-container p {
    margin: 0;
}

main {
    flex: 1;
    padding: 20px 0; /* 左右のpaddingを0に */
    display: flex;
    flex-direction: column;
    align-items: stretch; /* stretchに変更して子要素が幅いっぱいに広がるようにする */
    gap: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 160px); /* ヘッダーとフッターの高さを考慮。フッターの高さに応じて調整 */
    box-sizing: border-box;
}

.row-group {
    width: 90vw; /* 画面幅の90% */
    /* max-width: 1200px; */ /* 一旦コメントアウトして90vwの挙動を確認 */
    margin: 0 auto 10px auto; /* 中央揃えと下マージン */
}

.row-header {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #ccc;
    width: 100%; /* 親要素(.row-group)の幅いっぱいに */
}

footer {
    background-color: #add8e6; /* 水色に変更 */
    color: #333; /* 文字色を濃い色に変更 */
    text-align: center;
    padding: 1em 0;
    width: 100%;
    z-index: 10;
    position: relative; /* モバイル注記を配置するために必要に応じて */
}

.row-group .sound-button-wrapper {
    display: inline-flex;
    align-items: center;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 5px 10px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    width: auto;
    margin: 5px;
}

.row-group .sound-button-wrapper:hover {
    transform: translateY(-2px);
}

.sound-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    flex-grow: 1;
    margin-right: 10px;
}

.sound-button:hover {
    background-color: #0056b3;
}

.info-button {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 50%;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.info-button:hover {
    background-color: #545b62;
}

.modal {
    display: none;
    position: fixed;
    z-index: 20;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 480px;
    border-radius: 8px;
    text-align: center;
    position: relative;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#modal-thumbnail {
    width:100%; 
    max-width:480px; 
    aspect-ratio: 16/9; 
    object-fit: cover; 
    margin-bottom: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
}

#modal-url {
    color: #007bff;
    text-decoration: none;
    font-size: 1.1em;
}

#modal-url:hover {
    text-decoration: underline;
}

/* PC専用注記のスタイル (フッター内) */
.pc-only-notice {
    /* display: block; はデフォルト */
}

/* モバイル専用注記のスタイル */
.mobile-specific-notice {
    display: none; /* PCでは非表示 */
    text-align: center;
    padding: 10px;
    background-color: #f0f0f0;
    color: #555;
    font-size: 0.9em;
    width: 100%;
    box-sizing: border-box;
    /* order: 1; /* mainの最後に表示するためにflex orderを使う場合 */
}

@media (max-width: 768px) {
    header {
        padding: 0.8em 10px;
    }
    header h1 {
        font-size: 1.3em;
    }
    .volume-control-container label {
        font-size: 0.8em;
    }
    #volume-slider {
        width: 100px;
    }
    #click-counter-container {
        top: 8px;
        right: 10px;
        font-size: 0.75em;
    }
    main {
        padding: 10px;
        gap: 15px;
        max-height: calc(100vh - 130px - 40px); /* ヘッダー、フッター、モバイル注記の高さを考慮 */
        /* order: 0; /* モバイル注記の前に表示 */
    }
    .row-group {
        width: 100%; /* モバイルでは幅100% */
    }
    .row-header {
        font-size: 1.1em;
    }
    .row-group .sound-button-wrapper {
        margin: 3px;
        padding: 4px 8px;
    }
    .sound-button {
        font-size: 13px;
        padding: 7px 10px;
    }
    .info-button {
        padding: 5px 8px;
        font-size: 11px;
        width: 22px;
        height: 22px;
    }
    .modal-content {
        width: 90%;
        margin: 20% auto;
    }
    footer .pc-only-notice { /* PC専用注記をモバイルで非表示 */
        display: none;
    }
    .mobile-specific-notice {
        display: block; /* モバイルで表示 */
        margin-top: 15px; /* mainとの間に余白を調整 */
        margin-bottom: 15px; /* footerとの間に余白を調整 */
    }
}

