/* --- 既存のスタイル設定 --- */
* { box-sizing: border-box; }

:root { 
    --primary: #4a90e2; 
    --success: #2ecc71; 
    --error: #e74c3c;   
    --easy: #ff9f43;    
    --hard: #ee5253;
    --super-hard: #2d3436; 
    --region: #16a085;
}

body { 
    font-family: 'Helvetica Neue', Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif; 
    text-align: center; 
    background-color: #f5f7fa; 
    color: #333; 
    margin: 0; 
    padding: 15px; 
}

.container { 
    background: white; 
    max-width: 600px; 
    margin: 0 auto; 
    padding: 20px; 
    border-radius: 20px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
    width: 100%; 
    position: relative; 
}

/* --- 言語切り替え・ボタン等の既存スタイル（省略なし） --- */
.lang-switch { position: absolute; top: 15px; left: 15px; display: flex; gap: 5px; }
.lang-btn { padding: 4px 8px; font-size: 11px; cursor: pointer; border: 1px solid #ddd; background: white; border-radius: 4px; }
.lang-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
h1 { font-size: 22px; color: #2c3e50; margin-bottom: 20px; }
.mode-selection { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.mode-btn { padding: 18px; font-size: 17px; color: white; border: none; border-radius: 15px; cursor: pointer; transition: 0.3s; font-weight: bold; }
.mode-btn.easy { background-color: var(--easy); box-shadow: 0 6px 0 #e67e22; }
.mode-btn.hard { background-color: var(--hard); box-shadow: 0 6px 0 #c0392b; }
.mode-btn.super-hard { background-color: var(--super-hard); box-shadow: 0 6px 0 #000000; }
.mode-btn.region-btn { background-color: var(--region); box-shadow: 0 6px 0 #0e6655; }
.mode-btn:active { transform: translateY(3px); box-shadow: none; }
.quit-btn { position: absolute; top: 15px; right: 15px; padding: 5px 12px; font-size: 11px; background: #eee; border: 1px solid #ddd; border-radius: 20px; color: #666; cursor: pointer; }
#flag-container { height: 160px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
#flag-img { max-height: 100%; max-width: 100%; border: 1px solid #eee; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.options-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.btn { padding: 12px; font-size: 16px; cursor: pointer; border: 2px solid #e0e0e0; border-radius: 12px; background: white; transition: 0.2s; font-weight: bold; width: 100%; }
@media (hover: hover) { .option-btn:hover:not(:disabled) { border-color: var(--primary); background-color: #f0f7ff; } }
.correct-ans { background-color: var(--success) !important; color: white !important; border-color: var(--success) !important; }
.wrong-ans { background-color: var(--error) !important; color: white !important; border-color: var(--error) !important; }
.hidden { display: none; }
#score-display { font-size: 40px; color: var(--primary); margin: 10px 0; }
.history-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; margin: 20px 0; padding: 10px; background: #f9f9f9; border-radius: 10px; }
.history-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.flag-wrapper { width: 100%; aspect-ratio: 3/2; background-color: #eee; display: flex; align-items: center; justify-content: center; border: 1px solid #ddd; overflow: hidden; border-radius: 4px; }
.history-flag { max-width: 100%; max-height: 100%; object-fit: contain; }
.history-name { font-size: 9px; line-height: 1.1; height: 22px; overflow: hidden; }
.back-link { margin-top: 15px; display: inline-block; color: #7f8c8d; text-decoration: none; font-size: 13px; }
footer { margin-top: 20px; font-size: 11px; color: #999; text-align: center; }

/* --- 広告枠専用の新規スタイル --- */
.ad-slot {
    margin: 15px auto;
    max-width: 600px;
    width: 100%;
    min-height: 90px;
    background-color: #fafafa;
    border: 1px dashed #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ad-top { margin-bottom: 20px; }
.ad-bottom { margin-top: 30px; }
.ad-result { 
    min-height: 200px;
    border-radius: 10px;
    margin: 20px 0;
}
.ad-label { font-size: 10px; color: #ccc; margin: 5px 0; }