body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f6fa;
    color: #333;
    display: flex;
    flex-direction: column; /* 🆕 縦並びにする */
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.container {
    background-color: #ffffff;
    padding: 35px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    max-width: 440px;
    width: 90%;
}

/* タイトルエリア */
.site-title-area {
    text-align: left;
    margin-bottom: 25px;
    border-left: 4px solid #6c5ce7;
    padding-left: 12px;
}

.catchphrase {
    font-size: 11px;
    color: #888;
    margin: 0 0 3px 0;
    letter-spacing: 0.5px;
}

.site-title {
    font-size: 24px;
    font-weight: bold;
    color: #222;
    margin: 0;
    letter-spacing: 1px;
}

/* 共通：選択セクションのラベル */
.select-label {
    text-align: left;
    font-size: 11px;
    color: #999;
    font-weight: bold;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

/* グループ＆人数選択のボタングループ */
.group-selector, .member-selector {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
}

.tab-btn {
    flex: 1;
    background-color: #f0f0f5;
    color: #666;
    border: none;
    padding: 10px 5px;
    font-size: 13px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background-color: #6c5ce7;
    color: white;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.2);
}

/* 結果エリア */
.gacha-content {
    display: flex;
    align-items: center;
    gap: 25px;
    background-color: #fafafa;
    padding: 25px;
    border-radius: 16px;
    border: 1px solid #eee;
    margin-bottom: 30px;
}

/* 左側に配置するカラー */
#color-preview {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #eee, 0 4px 10px rgba(0,0,0,0.06);
    transition: background-color 0.4s ease;
}

/* 右側のテキストエリア */
.text-area {
    text-align: left;
    flex-grow: 1;
}

.label {
    font-size: 10px;
    color: #b0b0b0;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

/* カラーの右に名前配置 */
.name-box {
    margin-bottom: 15px;
}

#result-name {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 16px;
    font-weight: bold;
    color: #222;
    line-height: 1.4;
}

.name-item {
    display: inline-block;
    white-space: nowrap;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 名前の下にカラーコード */
#result-color-code {
    font-family: monospace;
    font-size: 18px;
    font-weight: bold;
    color: #555;
}

/* ガチャボタンエリア */
.button-area {
    text-align: center;
}

.gacha-btn {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    border: none;
    padding: 14px 50px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.25);
    transition: transform 0.1s, box-shadow 0.2s;
    width: 100%;
    max-width: 280px;
}

.gacha-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(108, 92, 231, 0.35);
}

.gacha-btn:active {
    transform: translateY(1px);
}

/* 結果をポストするボタンのデザイン */
.share-btn {
    display: inline-block;
    background-color: #f0f0f5; /* 初期状態は優しいグレー */
    color: #555;
    text-decoration: none;
    padding: 10px 0;
    font-size: 14px;
    font-weight: bold;
    border-radius: 30px;
    width: 100%;
    max-width: 280px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

/* マウスを乗せたときは、X(旧Twitter)っぽい少しシックな黒（または濃いグレー）に変化 */
.share-btn:hover {
    background-color: #2f3542;
    color: white;
    transform: translateY(-1px);
}

/* ==========================================
   📱 スマホ・タブレット用のレスポンシブ対応
   ========================================== */
@media (max-width: 480px) {
    body {
        padding: 15px; /* 画面端に少し余白を作る */
        justify-content: flex-start; /* 上詰めに直してスクロールしやすくする */
        min-height: calc(100vh - 30px);
    }

    .container {
        width: 100%; /* 画面の横幅いっぱいに広げる */
        max-width: 100%;
        padding: 25px 20px; /* 内側の余白をスマホ用にスリム化 */
        box-sizing: border-box;
    }

    /* タイトル周りを少しコンパクトに */
    .site-title {
        font-size: 22px;
        margin-top: 5px;
    }
    .catchphrase {
        font-size: 11px;
    }

    /* グループ・人数選択ボタンをスマホでも押しやすく */
    .group-selector, .member-selector {
        gap: 6px; /* ボタン同士の間隔を少し詰める */
        margin-bottom: 20px;
    }

    .tab-btn {
        padding: 10px 4px; /* 指でタップしやすく */
        font-size: 12px;    /* 画面が小さくても文字が回り込まないサイズ */
        flex: 1;            /* ボタンの横幅を均等に広げる */
        min-width: 0;       /* はみ出し防止 */
    }

    /* 🆕 ガチャ結果エリアを【縦並び】に大改造！ */
    .gacha-content {
        flex-direction: column; /* 丸い色とテキストを縦並びにする */
        gap: 15px;             /* 上下のスキマをちょうどよく */
        padding: 20px;
        align-items: center;    /* 中央揃えにする */
        text-align: center;
    }

    /* 🆕 丸い色のサイズをスマホ用に固定 */
    #color-preview {
        width: 80px;
        height: 80px;
    }

    /* 🆕 テキストエリアも中央揃えに */
    .text-area {
        text-align: center;
        width: 100%;
    }

    /* 🆕 名前が複数になっても綺麗に並ぶように調整 */
    #result-name {
        justify-content: center; /* 中央に集める */
        font-size: 18px;
    }

    /* 🆕 スマホでは名前の幅制限を解除して読みやすく */
    .name-item {
        max-width: 100%; 
    }

    /* メインボタンとシェアボタン */
    .gacha-btn, .share-btn {
        width: 100%;      /* ボタンを横いっぱいに広げて押しやすく */
        max-width: 100%;
        padding: 14px 0;  /* タップしやすい絶妙な厚みに */
        font-size: 16px;
    }
}