/**
 * 共通ゲームスタイルシート v1.5（元のバージョン）
 * 
 * 全クイズゲーム共通のCSS
 * CSS変数を使用してテーマカラーのカスタマイズに対応
 */

/* CSS変数定義 - カラーテーマ */
:root {
    /* メインカラーパレット */
    --primary-color: #2196f3;
    --primary-dark: #1976d2;
    --secondary-color: #4caf50;
    --secondary-dark: #388e3c;
    --accent-color: #ff4757;
    --accent-dark: #ff3838;
    --warning-color: #ff9800;
    --warning-dark: #f57c00;
    --purple-color: #9c27b0;
    --purple-dark: #7b1fa2;
    
    /* グレースケール */
    --text-primary: #333;
    --text-secondary: #555;
    --gray-light: #e0e0e0;
    --white-transparent: rgba(255,255,255,0.9);
    --white-semi: rgba(255,255,255,0.95);
    
    /* グラデーション背景 */
    --bg-gradient: linear-gradient(135deg, #e3f2fd, #bbdefb);
    
    /* 影とエフェクト */
    --shadow-light: 0 4px 15px;
    --shadow-medium: 0 5px 15px;
    --shadow-heavy: 0 6px 20px;
    
    /* サイズとスペーシング */
    --border-radius: 10px;
    --border-radius-large: 15px;
    --border-radius-xl: 25px;
    --spacing-xs: 5px;
    --spacing-sm: 8px;
    --spacing-md: 10px;
    --spacing-lg: 15px;
    --spacing-xl: 20px;
}

/* 基本レイアウト */
body {
    font-family: 'Arial', sans-serif;
    background: var(--bg-gradient);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.container {
    max-width: none;
    width: 100%;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-x: hidden;
}

/* 表紙ページのスタイル - MP4動画背景対応 */
.cover-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    overflow: hidden;
}

.cover-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
}

.cover-page::before {
    display: none;
}

.cover-page > * {
    position: relative;
    z-index: 2;
}

.cover-page h1 {
    display: none;
}

.cover-page .subtitle {
    display: none;
}

.start-btn {
    background: linear-gradient(145deg, var(--accent-color), var(--accent-dark));
    color: white;
    border: none;
    padding: var(--spacing-lg) 40px;
    border-radius: var(--border-radius-xl);
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light) rgba(255, 71, 87, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
}

.start-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: var(--shadow-heavy) rgba(255, 71, 87, 0.6);
    background: linear-gradient(145deg, var(--accent-dark), #ff2f2f);
}

/* 問題ページのスタイル */
.question-page {
    display: none;
}

/* 問題ページモード時のスタイル - PC版でスクロール可能 */
.container.question-mode {
    max-width: 500px !important;
    width: 90% !important;
    position: relative !important;
    padding: var(--spacing-lg) !important;
    background: transparent;
    border-radius: var(--spacing-xl);
    justify-content: flex-start !important;
    align-items: center !important;
    gap: var(--spacing-xs) !important;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0 auto;
}

.progress {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    gap: var(--spacing-sm);
    background: var(--white-transparent);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-large);
    position: sticky;
    top: 0;
    z-index: 10;
}

.progress-step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    transition: all 0.3s ease;
    font-size: 0.8em;
}

.progress-step.active {
    background: var(--primary-color);
    transform: scale(1.1);
}

.progress-step.completed {
    background: var(--secondary-color);
}

.image-container {
    width: 100%;
    max-width: 500px;
    height: 500px;
    margin: 0 auto var(--spacing-md) auto;
    border: 3px solid var(--primary-color);
    border-radius: var(--border-radius-large);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white-semi);
    overflow: hidden;
    position: relative;
}

.situation-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    color: var(--text-secondary);
    text-align: center;
    padding: 0;
    box-sizing: border-box;
    border-radius: 12px;
}

.situation-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.question-content-area {
    min-height: 300px;
    max-height: 300px;
    height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.question {
    font-size: 1.2em;
    margin: var(--spacing-md) 0;
    color: var(--text-primary);
    font-weight: bold;
    background: var(--white-transparent);
    padding: 12px;
    border-radius: var(--border-radius);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.choices {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    justify-content: flex-start;
    margin: var(--spacing-md) 0;
    align-items: center;
    flex: 1;
    min-height: 140px;
}

.choice-btn {
    background: linear-gradient(145deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 12px var(--spacing-xl);
    border-radius: var(--border-radius);
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 90%;
    max-width: 400px;
}

.choice-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium) rgba(33,150,243,0.4);
}

.choice-btn:active {
    transform: translateY(0);
}

.next-btn {
    background: linear-gradient(145deg, var(--secondary-color), var(--secondary-dark));
    color: white;
    border: none;
    padding: var(--spacing-md) 25px;
    border-radius: var(--border-radius);
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: var(--spacing-xs);
    transition: all 0.3s ease;
    height: 40px;
    flex-shrink: 0;
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium) rgba(76,175,80,0.4);
}

.result {
    margin: var(--spacing-md) 0;
    padding: 12px;
    border-radius: var(--border-radius);
    font-weight: bold;
    background: var(--white-semi);
    font-size: 0.95em;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
    line-height: 1.4;
    min-height: 50px;
    height: auto;
    overflow-y: visible;
}

.result[style*="display: none"] {
    visibility: hidden;
    min-height: 50px;
    height: 50px;
}

.result.good {
    color: #2e7d32;
    border-left: 3px solid var(--secondary-color);
}

.result.better {
    color: var(--warning-dark);
    border-left: 3px solid var(--warning-color);
}

.result.bad {
    color: #c62828;
    border-left: 3px solid #f44336;
}

/* 評価ページのスタイル */
.evaluation-page {
    display: none;
}

.evaluation-page h2 {
    color: var(--primary-dark);
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    margin-bottom: 25px;
    font-size: 1.8em;
}

.final-message {
    font-size: 1.2em;
    color: var(--text-primary);
    margin: var(--spacing-lg) auto;
    padding: var(--spacing-xl);
    background: var(--white-transparent);
    border-radius: var(--border-radius);
    max-width: 450px;
    line-height: 1.4;
    text-align: center;
}

.restart-btn {
    background: linear-gradient(145deg, var(--purple-color), var(--purple-dark));
    color: white;
    border: none;
    padding: 12px 35px;
    border-radius: var(--border-radius);
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    margin-top: var(--spacing-lg);
    transition: all 0.3s ease;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium) rgba(156,39,176,0.4);
}

/* ローディング表示 */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white-transparent);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    z-index: 1000;
}

/* モバイル対応 */
@media (max-width: 480px) {
    body {
        padding: 0;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .container {
        background: transparent;
        box-shadow: none;
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: none;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .container.question-mode {
        max-width: 400px !important;
        width: 95% !important;
        padding: var(--spacing-md) !important;
        margin: 0 auto !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: var(--spacing-sm) !important;
        overflow-x: hidden !important;
    }
    
    .cover-page {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 100;
        overflow: hidden;
    }
    
    .cover-video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover; /* モバイルでは cover */
        z-index: 1;
    }

    .cover-page::before {
        display: none;
    }

    .cover-page > * {
        position: relative;
        z-index: 2;
    }

    .cover-page h1 {
        display: none;
    }
    
    .cover-page .subtitle {
        display: none;
    }
    
    .start-btn {
        background: linear-gradient(145deg, var(--accent-color), var(--accent-dark)) !important;
        padding: var(--spacing-lg) 50px !important;
        font-size: 1.3em !important;
        border-radius: var(--border-radius-xl) !important;
        box-shadow: var(--shadow-light) rgba(255, 71, 87, 0.4) !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
        position: fixed !important;
        bottom: 60px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 101 !important;
        border: none !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
    }

    .start-btn:hover {
        transform: translateX(-50%) translateY(-2px) !important;
        box-shadow: var(--shadow-heavy) rgba(255, 71, 87, 0.6) !important;
        background: linear-gradient(145deg, var(--accent-dark), #ff2f2f) !important;
    }
    
    .progress {
        background: var(--white-transparent);
        padding: 6px;
        border-radius: var(--border-radius-large);
        margin: 0 0 var(--spacing-sm) 0;
        order: 1;
    }
    
    .progress-step {
        width: 28px;
        height: 28px;
        font-size: 0.75em;
    }
    
    /* モバイルでの画像コンテナ修正 */
    .image-container {
        width: calc(100vw - 40px);
        height: calc(100vw - 40px);
        max-width: 350px;
        max-height: 350px;
        background: var(--white-semi);
        margin: 0 auto var(--spacing-md) auto;
        order: 2;
        border-radius: var(--border-radius-large);
        overflow: hidden;
    }
    
    .situation-image {
        width: 100%;
        height: 100%;
        font-size: 1em;
        padding: 0;
        border-radius: 12px;
        overflow: hidden;
    }

    .situation-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        border-radius: 12px;
    }
    
    .question {
        background: var(--white-transparent);
        padding: 12px;
        border-radius: var(--border-radius);
        margin: 0 0 var(--spacing-md) 0;
        font-size: 1.1em;
        order: 3;
    }
    
    .choices {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
        margin: 0 0 var(--spacing-md) 0;
        order: 4;
    }
    
    .choice-btn {
        width: 95%;
        max-width: none;
        padding: 12px var(--spacing-xl);
        font-size: 1em;
    }
    
    .result {
        background: var(--white-semi) !important;
        margin: 0 0 var(--spacing-md) 0;
        padding: var(--spacing-md);
        font-size: 0.9em;
        order: 5;
        min-height: 40px;
        height: auto;
        overflow-y: visible;
    }
    
    .next-btn {
        padding: var(--spacing-md) 25px;
        font-size: 1em;
        margin: var(--spacing-xs) 0;
        order: 6;
    }
    
    .evaluation-page h2 {
        color: var(--primary-dark) !important;
        text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
        font-size: 1.8em;
        margin-bottom: var(--spacing-xl);
    }
    
    .final-message {
        background: var(--white-transparent) !important;
        font-size: 1.2em !important;
        padding: var(--spacing-xl) !important;
        margin: var(--spacing-xl) auto !important;
        line-height: 1.3;
    }
    
    .restart-btn {
        padding: var(--spacing-lg) 50px !important;
        font-size: 1.3em !important;
    }
}