/* 全体の基本設定 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background-color: #f5f0eb;
    color: #333333;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px 10px;
}

/* メインコンテナ */
.container {
    background-color: #ffffff;
    max-width: 650px;
    width: 100%;
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    border-top: 6px solid #b33e3e;
}

/* 見出し */
h1 {
    font-size: 1.8rem;
    color: #b33e3e;
    margin-bottom: 25px;
    letter-spacing: 2px;
}

/* ユーザー入力フォーム */
.user-info-form {
    background-color: #faf8f5;
    border: 1px solid #eee6dc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: left;
}

.form-group {
    margin-bottom: 15px;
    width: 100%;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: bold;
    color: #555555;
    margin-bottom: 6px;
}

/* 入力欄 & セレクトボックスの共通スタイル */
input[type="text"],
select {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px; /* スマホ自動ズーム防止 */
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
select:focus {
    border-color: #b33e3e;
}

/* 生年月日（年・月・日）の横並び配置 */
.birth-select-group {
    display: flex;
    gap: 8px;
}

.birth-select-group select {
    flex: 1;
}

/* ボタン共通 */
button {
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    border-radius: 30px;
    transition: all 0.2s ease;
}

/* おみくじ引きボタン */
#draw-btn {
    background-color: #b33e3e;
    color: #ffffff;
    padding: 14px 40px;
    width: 100%;
    max-width: 280px;
    box-shadow: 0 4px 10px rgba(179, 62, 62, 0.3);
    border-radius: 8px;
}

#draw-btn:hover {
    background-color: #8c2f2f;
    transform: translateY(-2px);
}

#draw-btn:disabled {
    background-color: #cccccc;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* 待機メッセージ */
#result-text {
    margin-top: 20px;
    font-size: 1rem;
    font-weight: bold;
    color: #b33e3e;
    min-height: 24px;
}

/* 生成画像コンテナ */
#image-container {
    margin-top: 20px;
}

#image-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* SNS共有エリア */
#share-area {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px dashed #cccccc;
}

#share-area p {
    font-size: 0.85rem;
    color: #666666;
    margin-bottom: 10px;
}

/* X（Twitter）投稿ボタン */
#x-share-btn {
    background-color: #000000;
    color: #ffffff;
    padding: 12px 24px;
    font-size: 0.95rem;
    width: 100%;
    max-width: 320px;
}

#x-share-btn:hover {
    background-color: #333333;
}

/* --------------------------------------------------
   アフィリエイトエリア：パソコン時（769px 以上：横並び）
   -------------------------------------------------- */
.affiliate-box {
    width: 100%;
    max-width: 600px;
    display: flex !important;
    flex-direction: row !important; /* PCは横並び */
    justify-content: center;
    align-items: flex-start !important;
    text-align: left;
    gap: 20px;
    margin-top: 30px;
}

.affiliate-box > div {
    text-align: center;
}

/* ---------- フッター ---------- */

.site-footer{

    max-width:600px;

    margin:24px auto 0;

    padding:0 16px 20px;

    text-align: center;

    font-size: 1rem;

    line-height:1.7;

    color:#555;

}

.site-footer p+p{

    margin-top:8px;

}

/* --------------------------------------------------
   スマホ・タブレット向け設定 (768px 以下：縦並び)
   -------------------------------------------------- */
@media screen and (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .user-info-form {
        padding: 15px 10px;
    }

    .birth-select-group {
        gap: 4px;
    }

    .birth-select-group select {
        padding: 8px 4px;
        font-size: 0.9rem;
    }

    #draw-btn, #x-share-btn {
        width: 100%;
        max-width: none;
    }

    /* スマホ画面では強制的に縦並び */
    .affiliate-box {
        flex-direction: column !important; /* 縦並びに強制変更 */
        align-items: center !important;
        gap: 15px;
        margin-top: 20px;
    }

    .affiliate-box > div {
        width: 100% !important;
        display: block !important;
        text-align: center;
    }
}