@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Noto+Sans+JP:wght@400;700&display=swap');

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: #f4f5f7;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding-bottom: 100px; /* フッター広告とかぶらないように余白 */
    box-sizing: border-box;
}

.container {
    background: white;
    width: 100%;
    max-width: 500px;
    padding: 40px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.08);
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 20px;
}

/* タイトル周り */
.logo { font-size: 2rem; font-weight: 800; letter-spacing: 2px; color: #1a202c; margin-bottom: 5px; }
.subtitle { font-size: 0.8rem; color: #718096; margin-bottom: 40px; letter-spacing: 1px; text-transform: uppercase; }

/* レベル選択ボタン */
.level-btn {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; padding: 20px; margin-bottom: 15px;
    border: 1px solid #e2e8f0; background: white; border-radius: 6px;
    cursor: pointer; transition: all 0.2s;
}
.level-btn:hover { border-color: #3182ce; box-shadow: 0 2px 10px rgba(49, 130, 206, 0.1); }
.level-btn .en { font-weight: 800; font-size: 1.1rem; color: #2d3748; }
.level-btn .jp { font-size: 0.9rem; color: #a0aec0; }

/* クイズヘッダー（戻るボタン対応） */
.quiz-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px; padding-bottom: 15px; border-bottom: 1px solid #edf2f7;
}
.header-right { text-align: right; }

/* 戻るボタン */
#back-btn {
    background: transparent; border: 1px solid #cbd5e0; color: #718096;
    padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; font-weight: bold;
}
#back-btn:hover { background: #edf2f7; color: #2d3748; }

.level-badge {
    font-size: 0.75rem; font-weight: 700; padding: 4px 8px;
    border: 1px solid #cbd5e0; border-radius: 4px; color: #718096; text-transform: uppercase; display: inline-block; margin-bottom: 4px;
}
.progress { font-weight: 700; color: #2d3748; font-size: 0.9rem; }

/* 問題文・選択肢 */
#question-text { font-size: 1.1rem; font-weight: 700; text-align: left; line-height: 1.7; margin-bottom: 30px; color: #1a202c; }
.option-btn {
    display: block; width: 100%; padding: 18px; margin-bottom: 12px;
    background: #f7fafc; border: 1px solid #edf2f7; border-radius: 6px;
    color: #4a5568; font-size: 1rem; font-weight: 500; cursor: pointer; transition: all 0.2s; text-align: left;
}
.option-btn:hover { background: #ebf8ff; border-color: #4299e1; color: #2b6cb0; }
.option-btn:disabled { cursor: default; opacity: 0.7; }

/* 入力・ソート */
input[type="text"] { width: 100%; padding: 15px; font-size: 1.2rem; border: 1px solid #e2e8f0; border-radius: 6px; margin-bottom: 20px; text-align: center; outline: none; box-sizing: border-box; }
input[type="text"]:focus { border-color: #3182ce; }
.sortable-item {
    background: white; padding: 15px; margin-bottom: 10px;
    border: 1px solid #e2e8f0; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: #4a5568;
}
.sort-controls button {
    background: transparent; border: 1px solid #cbd5e0; color: #718096;
    width: 30px; height: 30px; line-height: 28px; padding: 0; margin-left: 5px; cursor: pointer; border-radius: 4px;
}

/* アクションボタン */
#action-btn, #next-btn, .restart-btn {
    width: 100%; background: #1a202c; color: white; border: none; padding: 16px;
    font-size: 1rem; font-weight: 700; border-radius: 6px; cursor: pointer; margin-top: 10px; letter-spacing: 1px;
}
#action-btn:hover, #next-btn:hover, .restart-btn:hover { background: #2d3748; }

/* フィードバック・結果 */
#feedback-area { margin-top: 30px; padding-top: 20px; border-top: 1px solid #edf2f7; animation: fadeIn 0.3s ease; }
#feedback-title { font-size: 1.5rem; margin: 0 0 10px 0; letter-spacing: 1px; }
.correct { color: #38a169; }
.incorrect { color: #e53e3e; }
#feedback-text { font-size: 0.95rem; color: #718096; line-height: 1.6; margin-bottom: 20px; text-align: left; }
.score-display { font-size: 4rem; font-weight: 800; color: #1a202c; line-height: 1; }

.hidden { display: none !important; }

/* --------------------------------------------------
   広告フッター (固定)
-------------------------------------------------- */
#ad-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #e2e8f0;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
    text-align: center;
    backdrop-filter: blur(5px);
}
.ad-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 10px;
    position: relative;
}
.ad-label {
    font-size: 0.6rem;
    color: #cbd5e0;
    margin: 0 0 4px 0;
    text-align: right;
    padding-right: 5px;
}
#ad-image {
    max-width: 100%;
    height: auto;
    max-height: 80px; /* 高さを制限 */
    border-radius: 4px;
    border: 1px solid #edf2f7;
    transition: opacity 0.2s;
}
#ad-image:hover { opacity: 0.9; }

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