/*
 * style.css
 * オペラ・カクテル占い Webゲーム用
 * 【iOS対応・レイアウト互換性強化版】
 */

/* 1. box-sizingの統一とフォント互換性の強化 */
*, *::before, *::after {
    box-sizing: border-box; 
}

body {
    /* 互換性を高めるためにiOSで安定したフォントを追加 */
    font-family: 'Noto Serif JP', serif, 'Hiragino Mincho ProN', 'Yu Mincho', serif; 
    background-color: #1a1a1a;
    color: #f0e6d2;
    margin: 0;
    padding: 0;
    text-align: center;
    min-height: 100vh;

    /* 背景テクスチャ (bg_texture.jpg) の適用 */
    background-image: url('images/bg_texture.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center center;
}

header {
    padding: 20px 0;
    border-bottom: 2px solid #daa520;
    margin-bottom: 30px;
}

h1 {
    font-weight: 700;
    font-size: 2.5em;
    color: #daa520;
    letter-spacing: 3px;
    text-shadow: 0 0 5px rgba(218, 165, 32, 0.5);
}

main {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    /* 背景テクスチャを見せるため、半透明の背景を設定 */
    background: rgba(0, 0, 0, 0.7); 
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.step {
    display: none;
    padding: 40px 20px;
    animation: fadeIn 0.8s;
}

.step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 入力グループのスタイル */
.input-group {
    margin: 20px auto;
    max-width: 400px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
}

select {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    border: 1px solid #daa520;
    background-color: #333;
    color: #f0e6d2;
    border-radius: 5px;
    -webkit-appearance: none; 
    -moz-appearance: none;
    appearance: none;
}

/* ボタンのスタイル */
button {
    background-color: #daa520;
    color: #1a1a1a;
    border: none;
    padding: 12px 30px;
    margin-top: 30px;
    font-size: 1.1em;
    font-family: 'Noto Sans JP', sans-serif, 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.1s;
}

button:hover {
    background-color: #ffda6a;
    transform: translateY(-2px);
}

/* STEP 2: 運命のタクト */
.takt-container {
    padding: 50px;
}

#taktButton {
    width: 120px;
    height: 120px;
    line-height: 120px;
    margin: 30px auto;
    border-radius: 50%;
    background-color: #daa520;
    color: #1a1a1a;
    font-size: 3em;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(218, 165, 32, 0.7);
    transition: all 0.2s;
}

#taktButton:hover {
    background-color: #ffda6a;
    transform: scale(1.05);
}

/* STEP 3: 結果画面 */
.result-content {
    /* FlexboxのiOSプレフィックスを追加 */
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    text-align: left;
    gap: 30px;
    margin-top: 30px;
}

/* 修正点 1: 結果タイトル h2 のフォントサイズを調整 */
h2.result-title {
    font-size: 1.8em; 
    margin-bottom: 20px;
    color: #daa520;
    /* 長い文字列がはみ出さないように、単語間の折り返しを許可 */
    word-wrap: break-word; 
    overflow-wrap: break-word;
}

.image-display {
    -webkit-flex: 0 0 45%;
    flex: 0 0 45%; 
    max-width: 45%;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    gap: 15px;
}

.image-display img {
    width: 100%;
    height: auto; 
    border: 3px solid #daa520;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.text-display {
    -webkit-flex: 1;
    flex: 1;
    padding: 10px;
}

.result-title {
    color: #daa520;
}

h3#operaTitle {
    font-size: 2em;
    margin-bottom: 5px;
}

p.cocktail-name {
    font-style: italic;
    font-size: 1.2em;
    color: #ccc;
    border-bottom: 1px dashed #daa520;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.desc-box {
    margin-top: 20px;
    padding: 15px;
    border-left: 5px solid #a0522d;
    background: rgba(50, 0, 0, 0.5);
    border-radius: 3px;
}

.guidance-box {
    margin: 40px auto;
    padding: 20px;
    border: 2px dashed #daa520;
    background: #0d0d0d;
    text-align: left; /* テキストの視認性を上げるため左寄せに */
}

/* 修正点 2: イベント情報タイトル h3 のフォントサイズを調整 */
.guidance-box h3 {
    color: #ffda6a;
    font-size: 1.1em; /* イベント見出しを小さくして改行によるデザイン崩れを防ぐ */
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: bold;
}

/* 修正点 3: イベント情報内の強調テキスト p の行間とフォントサイズを調整 */
.guidance-box p {
    font-size: 0.9em;
    line-height: 1.6; /* 読みにくい改行を防ぐために行間を広げる */
}

footer {
    margin-top: 40px;
    padding: 15px 0;
    border-top: 1px solid #333;
    font-size: 0.8em;
}

/* 再生ボタンのスタイル */
.audio-control-box {
    margin: 20px 0;
    text-align: center;
}

#playAudioButton {
    background-color: #a0522d;
    color: #f0e6d2;
    /* 【修正済み】フォントサイズを縮小 */
    font-size: 1.05em; 
    padding: 15px 35px;
    border-radius: 8px;
    transition: background-color 0.3s;
    margin-top: 0; 
}

#playAudioButton:hover {
    background-color: #c0724d;
}

#audioIcon {
    margin-right: 10px;
    font-weight: bold;
}


/* スマートフォン向けの調整 (レスポンシブデザイン強化) */
@media (max-width: 768px) {
    .result-content {
        -webkit-flex-direction: column;
        flex-direction: column;
        gap: 20px;
    }
    .image-display {
        -webkit-flex: none;
        flex: none;
        max-width: 100%;
        align-items: center;
    }
    .image-display img {
        max-width: 90%;
    }
    h1 {
        font-size: 1.6em;
    }
    
    body {
        font-size: 0.95em; 
    }

    /* モバイルでの結果タイトルをさらに縮小 */
    h2.result-title {
        font-size: 1.5em; 
    }
}