﻿/* 全体レイアウト */
body { 
    font-family: sans-serif; 
    background: #f4f4f9; 
    display: flex; 
    flex-direction: column; 
    height: 100vh; 
    margin: 0; 
}

header { 
    background: #fff; 
    padding: 10px 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid #ddd; 
}

main { 
    flex: 1; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: relative; 
    padding: 20px; 
}

/* 画面切り替えの基本ルール */
.screen { 
    display: none; /* 基本は隠す */
    width: 100%; 
    max-width: 800px; /* 少し広めに調整 */
    margin: 0 auto; 
    text-align: center;
}

/* activeクラスがついた画面だけを表示 */
.screen.active { 
    display: block; 
}

/* クイズレイアウト */
.quiz-layout { 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
    align-items: center; 
    width: 100%; 
}

/* 選択肢ボタンのグリッド */
.options-grid { 
    display: grid; 
    grid-template-columns: repeat(5, 1fr); 
    gap: 8px; 
    width: 100%; 
    margin-top: 10px;
}

.option-btn { 
    height: 55px; 
    padding: 5px; 
    font-size: 0.9rem; 
    cursor: pointer; 
    border: 2px solid #ddd; 
    background: #fff; 
    border-radius: 6px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.2s;
}

.option-btn:hover {
    background-color: #f0f7ff;
    border-color: #007bff;
}

.option-btn.correct {
    background: #28a745 !important;
    color: white;
    border-color: #28a745;
}

.option-btn.wrong {
    background: #dc3545 !important;
    color: white;
    border-color: #dc3545;
}

.option-btn.gray {
    background: #6c757d !important;
    color: white;
    pointer-events: none;
}

/* 演出系（〇×・時間切れ） */
#feedback, #time-up-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    display: none;
    z-index: 9999;
    line-height: 1;
    white-space: nowrap;
    text-shadow: 4px 4px 0 #fff, -4px -4px 0 #fff, 4px -4px 0 #fff, -4px 4px 0 #fff, 0px 4px 0 #fff, 0px -4px 0 #fff, 4px 0px 0 #fff, -4px 0px 0 #fff, 0 0 20px rgba(0,0,0,0.4);
}

#feedback {
    font-weight: 900;
}

#time-up-message {
    font-size: 5rem !important;
    font-weight: bold;
    color: #ff4500;
}

/* その他パーツ */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%; animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#start-btn {
    padding: 15px 40px;
    font-size: 1.5rem;
    cursor: pointer;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 30px;
}

#image-container { 
    width: 100%;
    height: 200px; 
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255,255,255,0.3);
    border-radius: 10px;
}

.diff-btn {
    width: 140px;
    padding: 15px 10px;
    color: white;
    border: none; border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
    line-height: 1.2;
}

.diff-btn:hover {
    transform: scale(1.05);
}

/* JSから強制非表示にする用のクラス */
.hidden {
    display: none !important;
}


.diff-label { 
    font-size: 1.5rem; 
    font-weight: bold; 
    display: block;
}

.diff-time { 
    font-size: 0.8rem; 
    margin-top: 5px; 
    opacity: 0.9; 
    display: block;
}

#time-limit-bar {
    height: 10px;
    background-color: #28a745;
    width: 100%;
}
