/* --- ベーススタイル --- */
body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    background-color: #f0f4f8;
    color: #333;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

#game-container {
    width: 100%;
    max-width: 600px;
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: height 0.3s ease;
}

/* --- 画面切り替えアニメーション --- */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    animation: fadeInScreen 0.5s ease-out forwards;
}

.screen.active {
    display: flex;
}

@keyframes fadeInScreen {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- イントロ画面 --- */
#intro-screen {
    justify-content: center;
    cursor: pointer;
    background-color: #2c3e50;
    color: white;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 20;
    border-radius: 16px;
}

.intro-message {
    font-size: 2rem;
    font-weight: bold;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* --- タイトル画面 --- */
.game-title {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-top: 1rem;
    margin-bottom: 2rem;
    position: relative;
}

.game-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: #3498db;
    border-radius: 2px;
}

.title-img {
    max-width: 80%;
    height: auto;
    margin-bottom: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
    cursor: pointer; /* クリック可 */
}

.title-img:hover {
    transform: scale(1.00);
}

.title-img:active {
    transform: scale(0.99);
}

/* --- 音量調整バー --- */
.volume-control {
    position: absolute;
    bottom: 20px;
    right: 25px;
    text-align: right;
    font-size: 0.8rem;
    color: #95a5a6;
}

.volume-control input[type=range] {
    display: block;
    margin-top: 5px;
    cursor: pointer;
    accent-color: #3498db;
}

/* --- ボタン共通 --- */
.btn {
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: bold;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.3);
}

.btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- クイズ画面レイアウト --- */
.quiz-header {
    width: 100%;
    margin-bottom: 1.5rem;
}

.header-info {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    color: #7f8c8d;
    margin-bottom: 0.8rem;
}

#timer-container {
    width: 100%;
    height: 8px;
    background-color: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
}

#timer-bar {
    width: 100%;
    height: 100%;
    background-color: #3498db;
    border-radius: 4px;
    transition: width 0.1s linear, background-color 0.3s ease;
}

#timer-bar.danger {
    background-color: #e74c3c;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.question-box {
    width: 100%;
    min-height: 120px;
    font-size: 1.3rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #2c3e50;
}

.choices-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    width: 100%;
    margin-bottom: 0;
    flex-grow: 1;
}

/* 選択肢ボタン */
.choice-btn {
    padding: 1.2rem;
    background-color: white;
    border: 2px solid #bdc3c7;
    color: #34495e;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    opacity: 0;
}

.choice-btn.animate-in {
    animation: fadeInUp 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.choice-btn:hover:not(:disabled) {
    background-color: #ecf0f1;
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-2px);
}

/* --- フィードバック --- */
.overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.feedback-content {
    text-align: center;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#feedback-icon {
    font-size: 8rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

#feedback-msg {
    font-size: 2rem;
    margin-bottom: 2.5rem;
    font-weight: bold;
    color: #34495e;
}

.correct { color: #2ecc71; }
.incorrect { color: #e74c3c; }

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- リザルト --- */
.score-display {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 2rem 0;
    color: #3498db;
}

#review-container {
    width: 100%;
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: left;
    background-color: #fdfdfd;
}

#review-container::-webkit-scrollbar { width: 8px; }
#review-container::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
#review-container::-webkit-scrollbar-thumb { background: #bdc3c7; border-radius: 4px; }

.review-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.review-item:last-child { border-bottom: none; }
.review-item:hover { background-color: #f9f9f9; }

.review-q { font-weight: bold; display: block; margin-bottom: 6px; color: #2c3e50; }
.review-a { display: block; color: #7f8c8d; font-size: 0.9rem; }
.review-status { font-weight: bold; margin-right: 8px; font-size: 1.2rem; }
.status-o { color: #2ecc71; }
.status-x { color: #e74c3c; }
/* 画像に置き換わった時、下線を消したい場合はこれを追加 */
.game-title:has(img)::after {
    display: none;
}
/* 虹色アニメーションの定義 */
@keyframes rainbow-glow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 隠しモード用のクラス */
body.secret-mode {
    background: linear-gradient(270deg, #ff9a9e, #fad0c4, #fee140, #96e6a1, #89f7fe, #66a6ff, #ff9a9e);
    background-size: 400% 400%;
    animation: rainbow-glow 3s ease infinite;
}