body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    background: linear-gradient(135deg, #2d151e 0%, #4a1f2f 100%);
    color: #f5e6eb;
    margin: 0;
    padding: 20px;
    text-align: center;
    min-height: 100vh;
    box-sizing: border-box;
}
h1 {
    font-size: clamp(14px, 8.00px + 1.56vw, 24px);
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 1px;
}

/* コントロールボタンエリア */
.controls {
    margin-bottom: 35px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.btn {
    display: inline-block;
    padding: 10px 24px;
    margin: 0;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    color: #f5e6eb;
    background-color: #5a2a3c;
    border: 1px solid #7d3c54;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    letter-spacing: 1px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.5);
    box-sizing: border-box;
}
.btn:hover {
    background-color: #73354d;
    border-color: #944565;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}
/* ボタンごとの識別ライン */
.btn-home { border-left: 3px solid #27ae60; }
.btn-start { border-left: 3px solid #e67e22; }
.btn-stop { border-left: 3px solid #c0392b; }

/* ギャラリーグリッド */
.gallery-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto 30px auto;
}

/* がく（額縁）付きフレーム（基本6:5比率） */
.thumbnail-frame {
    width: 60px;
    height: 50px;
    padding: 3px;
    background: #3d1d29;
    border: 2px solid #6b3248;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.4), inset 1px 1px 2px rgba(255,255,255,0.05);
    cursor: pointer;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.thumbnail-frame:hover {
    transform: scale(1.1);
    border-color: #9e4b6b;
}
.thumbnail-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ページネーション */
.pagination {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 6px 12px;
    text-decoration: none;
    color: #d9afbd;
    background: #241118;
    border: 1px solid #4a2130;
    border-radius: 3px;
    font-size: 13px;
    transition: background 0.2s, color 0.2s;
}
.pagination a:hover {
    background-color: #3d1d29;
    color: #ffffff;
    border-color: #6b3248;
}
.pagination .current {
    background-color: #6b3248;
    color: #ffffff;
    border-color: #8c425e;
    font-weight: bold;
}

/* ポップアップモーダル層（ズーム・スライド共通） */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 5, 10, 0.9);
    align-items: center;
    justify-content: center;
}

/* ダークピンク額縁フレーム（基本6:5比率） */
.modal-content-frame {
    width: 360px;
    height: 300px;
    padding: 10px;
    background: #331822;
    border: 4px solid #6b3248;
    box-shadow: 0px 10px 30px rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
}
.modal-content-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #12050a;
}
/* 画面を閉じるための案内 */
.close-hint {
    position: absolute;
    bottom: -35px;
    left: 0;
    width: 100%;
    color: #bfa1ac;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    letter-spacing: 1px;
}

/* =========================================
   レスポンシブ対応（各ブレイクポイント調整）
   ========================================= */

/* 1. PC・大型ディスプレイ (1024px以上) */
@media screen and (min-width: 1024px) {
    body { padding: 30px; }
    .gallery-container { gap: 14px; }
    .thumbnail-frame { width: 72px; height: 60px; }
    .modal-content-frame { width: 480px; height: 400px; }
}

/* 2. タブレット横・小型ノートPC (835px 〜 1023px) */
@media (min-width: 835px) and (max-width: 1023px) {
    body { zoom: 1.6; padding: 24px; }
    .gallery-container { gap: 12px; }
    .thumbnail-frame { width: 66px; height: 55px; }
    .modal-content-frame { width: 420px; height: 350px; }
}

/* 3. iPad縦・標準タブレット (744px 〜 834px) */
@media (min-width: 744px) and (max-width: 834px) {
    body { zoom: 1.5; padding: 20px; }
    .gallery-container { gap: 12px; }
    .thumbnail-frame { width: 60px; height: 50px; }
    .modal-content-frame { width: 390px; height: 325px; }
}

/* 4. 小型タブレット・大型ファブレット (541px 〜 743px) */
@media (min-width: 541px) and (max-width: 743px) {
    body { zoom: 1.4; padding: 18px; }
    .controls { margin-bottom: 28px; }
    .gallery-container { gap: 10px; }
    .thumbnail-frame { width: 60px; height: 50px; }
    .modal-content-frame { width: 360px; height: 300px; }
}

/* 5. 大画面スマホ・横向きスマホ (441px 〜 540px) */
@media (min-width: 441px) and (max-width: 540px) {
    body { zoom: 1.3; padding: 16px; }
    .controls { margin-bottom: 24px; gap: 6px; }
    .btn { padding: 9px 18px; font-size: 12px; }
    .gallery-container { gap: 9px; }
    .thumbnail-frame { width: 54px; height: 45px; }
    .modal-content-frame { width: 348px; height: 290px; }
}

/* 6. 標準〜大きめスマホ：iPhone Plus / Pro Max等 (391px 〜 440px) */
@media (min-width: 391px) and (max-width: 440px) {
    body { padding: 14px; }
    .controls { margin-bottom: 22px; gap: 6px; }
    .btn { padding: 8px 14px; font-size: 12px; }
    .gallery-container { gap: 8px; }
    .thumbnail-frame { width: 54px; height: 45px; }
    .modal-content-frame { width: 336px; height: 280px; }
}

/* 7. 標準スマホ：iPhone 12/13/14/15/16等 (381px 〜 390px) */
@media (min-width: 381px) and (max-width: 390px) {
    body { padding: 12px; }
    .controls { margin-bottom: 20px; gap: 6px; }
    .btn { padding: 8px 12px; font-size: 12px; }
    .gallery-container { gap: 8px; }
    .thumbnail-frame { width: 51px; height: 42.5px; }
    .modal-content-frame { width: 324px; height: 270px; }
}

/* 8. コンパクトスマホ：iPhone SE / mini等 (375px 〜 380px) */
@media (min-width: 375px) and (max-width: 380px) {
    body { padding: 12px; }
    .controls { margin-bottom: 20px; gap: 5px; }
    .btn { padding: 8px 11px; font-size: 11px; letter-spacing: 0.5px; }
    .gallery-container { gap: 7px; }
    .thumbnail-frame { width: 48px; height: 40px; }
    .pagination a, .pagination span { padding: 5px 10px; font-size: 12px; }
    .modal-content-frame { width: 312px; height: 260px; padding: 8px; }
}

/* 9. 超小型スマホ：旧型iPhone / Galaxy Fold閉時等 (374px以下) */
@media (max-width: 374px) {
    body { padding: 10px; }
    h1 { margin-bottom: 14px; }
    .controls { margin-bottom: 18px; gap: 4px; }
    .btn { padding: 7px 10px; font-size: 11px; letter-spacing: 0; }
    .gallery-container { gap: 6px; }
    .thumbnail-frame { width: 45px; height: 37.5px; padding: 2px; border-width: 1px; }
    .pagination { gap: 4px; margin: 20px 0; }
    .pagination a, .pagination span { padding: 4px 8px; font-size: 11px; }
    .modal-content-frame { width: 276px; height: 230px; padding: 6px; border-width: 3px; }
    .close-hint { font-size: 11px; bottom: -28px; }
}
