/* --- リセットCSS (簡略版) --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: auto; 
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* -------------------- ⭐️ 共通スタイル ⭐️ -------------------- */

#app {
    min-height: 100vh;
}

/* 共通の背景色とパディング */
.full-screen-section, .content-section {
    background-color: #A9B8A3; /* 画像の薄い緑色 */
    padding: 30px 40px; 
    position: relative;
    overflow: hidden; 
}


/* --- 1. セクション1: 全画面表示 (画像1) --- */

#section1 {
    min-height: 100vh; 
    display: flex;
    flex-direction: column;
}

/* 1.1 ヘッダー/ナビゲーション */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 20px; 
    z-index: 5;
    color: #444; 
}

.logo .collection-name {
    font-size: 0.8em;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 5px;
}

.logo h1 {
    font-size: 3em;
    font-weight: 300; 
    line-height: 1;
}

.logo .subtitle {
    font-size: 0.8em;
    letter-spacing: 0.2em;
    margin-top: 5px;
}

.main-nav ul {
    display: flex;
    gap: 30px; 
    font-size: 0.9em;
}

.main-nav a:hover {
    text-decoration: underline;
}

/* 1.2 メインコンテンツ (左右分割) */
.main-content {
    flex-grow: 1; 
    display: flex;
    align-items: stretch; 
}

.left-spacer {
    flex-basis: 40%; 
    background-color: transparent;
}

.right-image-panel {
    flex-basis: 60%; 
    background-image: url('omar-ramadan-vcRHpfrsaL8-unsplash.jpg'); 
    background-size: cover; 
    background-position: center; 
}

/* 1.3 左下隅の三角形の要素（装飾用） */
.corner-design {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 150px;
    height: 150px;
    background-color: transparent;
    border-top: 150px solid transparent;
    border-right: 150px solid #fff;
    transform: rotate(135deg); 
    transform-origin: bottom left;
}


/* -------------------- ⭐️ 共通の固定ボタン ⭐️ -------------------- */

.fixed-buttons {
    position: fixed;
    top: 0;
    right: 40px; 
    height: 100vh; 
    display: flex;
    flex-direction: column;
    justify-content: center; 
    gap: 20px;
    pointer-events: none; 
    z-index: 100; 
}

.fixed-buttons a {
    background-color: #fff;
    color: #444;
    padding: 10px 5px;
    font-size: 0.8em;
    font-weight: bold;
    letter-spacing: 0.1em;
    writing-mode: vertical-rl; 
    border: 1px solid #444;
    cursor: pointer;
    pointer-events: auto; 
    transition: background-color 0.3s;
}

.fixed-buttons a:hover {
    background-color: #f0f0f0;
}


/* -------------------- ⭐️ セクション2: コピーセクション (左右入れ替え) ⭐️ -------------------- */

#section2 {
    min-height: 100vh;
    padding-top: 80px; 
    color: #fff; 
    display: flex;
    flex-direction: column;
}

.section2-content-wrapper {
    flex-grow: 1; 
    display: flex;
    justify-content: space-between;
    align-items: flex-start; 
}

/* 2.1 左側: テキストエリア (配置が左側に確定) */
.section2-left-text {
    flex-basis: 50%; 
    padding-right: 50px; 
    padding-left: 0; 
    font-weight: 300; 
    text-align: left; 
}

.section2-logo {
    font-size: 1.5em;
    font-weight: bold;
    /* ⬇️ このマージンの分、画像を開始位置を調整する必要があります */
    margin-bottom: 50px; 
    color: #444; 
}

.main-copy-wrapper {
    margin-bottom: 50px; 
}

.section2-left-text h2 {
    font-size: 2.5em;
    margin-bottom: 0; 
    line-height: 1.2;
    color: #fff; 
    white-space: normal;
    width: auto; 
}

.section2-left-text .text-block {
    margin-bottom: 40px; 
    font-size: 1.1em;
    line-height: 1.8;
    text-align: left;
}

/* 2.2 右側: 画像とナビゲーション (配置が右側に確定) */
.section2-right-visual {
    flex-basis: 50%; 
    position: relative;
    transform: none; 
    
    /* ⬇️ ナビゲーションの高さ＋ロゴのマージンの分、画像エリア全体を下にずらします */
    /* .section2-logoの高さとマージン、h2の高さなどを推定してpaddingを設定 */
    padding-top: 140px; /* ⬅️ 画像の開始位置を '世界を刺激する、銘品を。' に合わせるための調整値 */
}

.y-image-panel {
    width: 40%; 
    height: 100%; /* ⬅️ 残りの高さを取得し、テキストの高さに合わせる */
    overflow: hidden;
    position: relative;
    transform: none; 
    margin: 0 auto 0 0; /* ⬅️ 右側に寄せて、テキストと同じ高さに調整 */
    
    /* Flexアイテム内で画像を中央揃えにする設定 */
    display: flex;
    justify-content: center;
    align-items: center;
}

.full-size-y-image {
    width: 100%; 
    height: 100%;
    object-fit: contain; /* 画像がラッパー内でアスペクト比を維持して収まるように変更 */
    display: block;
    margin: 0; 
    transform: none; 
}


/* 2.3 ナビゲーションの位置調整 */
.section2-nav {
    position: absolute;
    top: 0;
    right: 0; 
    left: auto;
    z-index: 20;
    padding: 0 0; 
}

.section2-nav ul {
    display: flex;
    gap: 30px; 
    font-size: 0.9em;
    color: #444; 
}
.section2-nav a {
    color: #444; 
}

/* 2.4 ページ下部のタイトル (変更なし) */
.bottom-title {
    text-align: center;
    font-size: 3em;
    font-weight: 300;
    letter-spacing: 0.1em;
    padding-top: 100px; 
    padding-bottom: 50px;
    color: #fff;
}

/* -------------------- ⭐️ セクション3: ブランド紹介グリッド ⭐️ -------------------- */

.brand-grid-section {
    min-height: 100vh;
    padding-top: 100px; 
    padding-bottom: 100px;
    text-align: center; 
}

.brand-grid-section .section-title {
    font-size: 1.5em;
    font-weight: 300;
    letter-spacing: 0.15em;
    margin-bottom: 100px;
}

.brand-cards-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 30px; 
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 0 40px; 
    margin-bottom: 80px;
}

.brand-card {
    display: block;
    text-align: left;
    transition: opacity 0.3s;
    color: inherit; 
    text-decoration: none;
}

.brand-card:hover {
    opacity: 0.7; 
}

.brand-card .card-image {
    width: 100%;
    height: 350px; 
    background-size: cover;
    background-position: center;
    margin-bottom: 20px;
}

.brand-card .card-title {
    font-size: 1.5em;
    font-weight: 500;
    margin-bottom: 5px;
    color: #fff;
}

.brand-card .card-subtitle {
    font-size: 0.9em;
    font-weight: 300;
    opacity: 0.8;
}

.all-brands-link {
    display: inline-block;
    margin-top: 50px;
    font-size: 1.1em;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: #fff;
    padding-bottom: 5px;
    border-bottom: 1px solid #fff;
    transition: border-bottom-color 0.3s;
}

.all-brands-link:hover {
    border-bottom-color: transparent;
}


/* -------------------- ⭐️ タイピングゲームの共通スタイルと表示切り替え ⭐️ -------------------- */

/* ゲーム本体のラッパーを初期状態で非表示にする */
.game-wrapper {
    display: none; 
}

/* ゲーム選択画面 */
#game-selection-screen {
    max-width: 900px; 
    margin: 100px auto 100px;
    padding: 40px;
    background-color: #7b8e73;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
}

/* 4つ並べるためのグリッドスタイル */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 30px;
}

.game-select-button {
    padding: 15px 10px;
    font-size: 1.1em; 
    font-weight: bold;
    color: #444;
    background-color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.game-select-button:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

.back-button {
    margin-top: 30px;
    padding: 10px 20px;
    font-size: 1em;
    background-color: #f0f0f0;
    color: #444;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.back-button:hover {
    background-color: #ccc;
}


/* -------------------- ⭐️ ゲーム情報表示エリア ⭐️ -------------------- */
#game-info, #game-info-2, #game-info-3, #game-info-4 {
    margin: 20px 0;
    padding: 10px;
    font-size: 1.1em;
    color: #fff;
    border: 1px solid #fff;
    border-radius: 5px;
    width: 100%;
}

#game-info p, #game-info-2 p, #game-info-3 p, #game-info-4 p {
    margin: 0;
    font-weight: 500;
}

/* -------------------- ⭐️ ゲームセクションごとの個別スタイル ⭐️ -------------------- */
/* 基本スタイル (Game 1) */
#typing-game-section {
    max-width: 800px;
    margin: 100px auto 50px; 
    padding: 40px;
    background-color: #7b8e73; 
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
}
#typing-game-section #target-text {
    background-color: #6e7d67;
}

/* Game 2 スピードチャレンジ */
#typing-game-section-2 {
    max-width: 800px;
    margin: 50px auto 100px; 
    padding: 40px;
    background-color: #a9857d; 
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
}
#typing-game-section-2 #target-text-2 {
    background-color: #936a5c;
}

/* -------------------- ⭐️ NEW GAME 3: 都道府県名 ⭐️ -------------------- */
#typing-game-section-3 {
    max-width: 800px;
    margin: 50px auto 100px; 
    padding: 40px;
    background-color: #6a7d93; 
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
}
#typing-game-section-3 #target-text-3 {
    background-color: #5d7088;
}

/* -------------------- ⭐️ NEW GAME 4: ことわざ ⭐️ -------------------- */
#typing-game-section-4 {
    max-width: 800px;
    margin: 50px auto 100px; 
    padding: 40px;
    background-color: #7d936a; 
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
}
#typing-game-section-4 #target-text-4 {
    background-color: #70885d;
}

/* -------------------- ⭐️ 共通のテキストフィールド・ボタン ⭐️ -------------------- */
#target-text, #target-text-2, #target-text-3, #target-text-4 {
    font-size: 2.2em;
    font-weight: bold;
    margin-bottom: 5px; /* ローマ字表示のためにマージンを減らす */
    padding: 20px;
    border: 2px dashed #fff;
    border-radius: 5px;
    min-height: 80px; 
    color: #ccc; 
    user-select: none;
    width: 100%;
    text-align: center;
    line-height: 1.2;
}

#target-text span, #target-text-2 span, #target-text-3 span, #target-text-4 span {
    transition: color 0.1s;
    color: #ccc; 
}

/* ⭐️ NEW: ローマ字表示エリアのスタイル ⭐️ */
.roman-text {
    font-family: monospace; /* ローマ字が見やすいフォント */
    font-size: 1.2em;
    font-weight: normal;
    color: #ccc;
    margin-bottom: 20px; /* 入力欄までのスペースを確保 */
    min-height: 20px;
    text-align: center;
}

.roman-text span {
    transition: color 0.1s;
    color: #ccc;
}
/* ローマ字のハイライトはJSで直接設定しています */


#typing-input, #typing-input-2, #typing-input-3, #typing-input-4 {
    width: 100%;
    padding: 15px;
    font-size: 1.5em;
    margin-bottom: 20px;
    border: 2px solid #fff;
    border-radius: 5px;
    text-align: center;
    background-color: #fff;
    color: #444;
}

#start-button, #start-button-2, #start-button-3, #start-button-4 {
    padding: 12px 30px;
    font-size: 1.2em;
    font-weight: bold;
    color: #fff; 
    background-color: #936a5c; 
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

#start-button:hover, #start-button-2:hover, #start-button-3:hover, #start-button-4:hover {
    background-color: #6e9b67;
}

#result, #result-2, #result-3, #result-4 {
    margin-top: 20px;
    font-size: 1.1em;
    color: #fff;
    min-height: 30px;
}