:root {
    --primary: #4a90e2;
    --bg-body: #f4f7f6;
    --text: #2d3436;
    --card-bg: #ffffff;
    --gray-bg: #dfe6e9;
    --shadow: 0 4px 20px rgba(0,0,0,0.05);
}

body.dark-mode {
    --primary: #3498db;
    --bg-body: #1e272e;
    --text: #dfe6e9;
    --card-bg: #2d3436;
    --gray-bg: #4b6584;
}

body {
    font-family: 'Segoe UI', Roboto, "Apple SD Gothic Neo", sans-serif;
    background-color: var(--bg-body);
    color: var(--text);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 900px;
    padding: 20px;
    box-sizing: border-box;
    flex: 1;
    display: flex;
    flex-direction: column;
}

header { text-align: center; margin: 30px 0; }
.logo { font-size: 2.5rem; margin: 0; color: var(--primary); font-weight: 900; letter-spacing: -1px; }
header p { color: #888; margin-top: 10px; font-size: 1rem; }

/* 대시보드 그리드 */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
@media (min-width: 768px) {
    .dashboard-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.card {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 25px;
    text-align: center;
    border: 1px solid rgba(0,0,0,0.03);
}
h3 { margin-top: 0; margin-bottom: 20px; color: #555; font-size: 1.1rem; }

/* 설정 버튼 그리드 */
.setting-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr 1fr; 
    gap: 10px; 
    margin-bottom: 20px; 
}

.option-btn {
    padding: 12px; background: var(--gray-bg); border: none; border-radius: 12px;
    font-weight: bold; color: var(--text); cursor: pointer; transition: 0.2s;
    font-size: 0.9rem;
}
.option-btn.active { background: var(--primary); color: white; }

.setting-group label { display: block; margin-bottom: 10px; font-weight: bold; font-size: 0.9rem; }
.segmented-control { display: flex; background: var(--gray-bg); border-radius: 12px; padding: 4px; }
.segment-btn {
    flex: 1; border: none; background: transparent; padding: 10px; border-radius: 10px;
    font-weight: bold; color: var(--text); cursor: pointer; transition: 0.2s;
}
.segment-btn.active { background: var(--card-bg); color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

/* 난이도 버튼 */
.level-grid { display: grid; gap: 12px; }
.level-btn {
    display: flex; align-items: center; padding: 15px 20px; border: none; border-radius: 16px;
    color: white; cursor: pointer; transition: transform 0.2s; text-align: left;
}
.level-btn:hover { transform: translateY(-2px); }
.level-btn:active { transform: scale(0.98); }
.level-btn .icon { font-size: 1.8rem; margin-right: 15px; }
.btn-text-group { display: flex; flex-direction: column; }
.level-btn .text { font-size: 1.1rem; font-weight: bold; }
.level-btn .sub { font-size: 0.75rem; opacity: 0.9; }

.easy { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.normal { background: linear-gradient(135deg, #f1c40f, #f39c12); color: #333 !important; }
.hard { background: linear-gradient(135deg, #e74c3c, #c0392b); }

/* 블로그 섹션 */
.blog-section { width: 100%; margin-top: 60px; margin-bottom: 40px; }
.section-header { text-align: center; margin-bottom: 30px; }
.section-header h2 { font-size: 2rem; color: var(--text); margin-bottom: 10px; }
.section-header p { color: #888; font-size: 1.1rem; }

/* 🌟 [수정됨] 블로그 그리드: 2x2 스타일 강제 적용 */
.blog-grid {
    display: grid;
    grid-template-columns: 1fr; /* 모바일: 1줄 */
    gap: 25px;
    margin-bottom: 50px;
}

@media (min-width: 600px) {
    .blog-grid {
        /* 화면이 넓어지면 무조건 2개씩 배치 (2x2 Grid) */
        grid-template-columns: repeat(2, 1fr); 
    }
}

.blog-card {
    background: var(--card-bg); border-radius: 20px; overflow: hidden;
    box-shadow: var(--shadow); transition: transform 0.3s ease;
    display: flex; flex-direction: column; text-align: left;
    border: 1px solid rgba(0,0,0,0.05);
}
.blog-card:hover { transform: translateY(-8px); }
.blog-thumb { width: 100%; height: 160px; background-size: cover; background-position: center; border-bottom: 1px solid #eee; }
.blog-content { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.category { font-size: 0.75rem; font-weight: 800; color: var(--primary); text-transform: uppercase; margin-bottom: 10px; }
.blog-content h4 { margin: 0 0 10px 0; font-size: 1.1rem; color: var(--text); line-height: 1.4; }
.blog-content p { font-size: 0.9rem; color: #666; line-height: 1.6; margin-bottom: 20px; flex-grow: 1; }
.read-more { font-weight: bold; color: var(--primary); text-decoration: none; font-size: 0.85rem; }

/* SEO 텍스트 */
.seo-text-box { background: rgba(255,255,255,0.6); padding: 40px; border-radius: 20px; margin-bottom: 50px; border: 1px solid rgba(0,0,0,0.05); }
.seo-text-box h3 { margin-top: 0; color: var(--text); }
.seo-text-box p { line-height: 1.8; color: #555; }
.seo-text-box strong { color: var(--primary); }

/* FAQ */
.faq-container { background: var(--card-bg); padding: 40px; border-radius: 25px; box-shadow: var(--shadow); }
.faq-container h3 { text-align: center; margin-top: 0; margin-bottom: 30px; font-size: 1.8rem; }
.faq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.faq-box { padding: 15px; border-bottom: 1px solid #eee; }
.faq-box h5 { margin: 0 0 8px 0; color: var(--primary); font-size: 1rem; }
.faq-box p { margin: 0; font-size: 0.9rem; color: #666; }

/* 퀴즈/결과 화면 */
.quiz-container-max { max-width: 500px; margin: 0 auto; width: 100%; }
.image-area { width: 100%; height: 350px; background: #eee; border-radius: 15px; overflow: hidden; margin-bottom: 20px; position: relative; }
#word-image { width: 100%; height: 100%; object-fit: cover; }
.blurred #word-image { filter: blur(20px); cursor: pointer; }
.blur-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; justify-content: center; align-items: center; color: white; font-weight: bold; font-size: 1.2rem; text-shadow: 0 2px 10px rgba(0,0,0,0.5); pointer-events: none; }
.blurred .blur-overlay { display: flex; }

.input-area { display: flex; gap: 10px; height: 50px; }
input { flex: 1; padding: 0 15px; border: 2px solid var(--gray-bg); border-radius: 12px; font-size: 1.1rem; }
input:focus { border-color: var(--primary); outline: none; }
#submit-btn { background: var(--primary); color: white; border: none; padding: 0 25px; border-radius: 12px; font-weight: bold; cursor: pointer; }
#feedback { height: 25px; margin-top: 15px; font-weight: bold; font-size: 1.1rem; }

/* 광고 배너 */
.ad-banner { width: 100%; height: 100px; background-color: var(--gray-bg); margin: 20px 0; display: flex; justify-content: center; align-items: center; border-radius: 15px; border: 2px dashed #ccc; overflow: hidden; }
.small-banner { height: 60px; margin-bottom: 15px; }

/* 푸터 */
.site-footer { width: 100%; background: #2d3436; color: #b2bec3; padding: 40px 0; margin-top: auto; text-align: center; font-size: 0.85rem; }
.footer-links a { color: #dfe6e9; text-decoration: none; margin: 0 10px; }
.footer-links a:hover { color: white; }

/* 화면 전환 */
.screen { display: none; }
.screen.active { display: block; animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 결과 화면 */
.score-circle { width: 150px; height: 150px; background: var(--gray-bg); border-radius: 50%; display: flex; flex-direction: column; justify-content: center; align-items: center; margin: 30px auto; color: var(--primary); }
#final-score { font-size: 4rem; font-weight: 800; line-height: 1; }
.restart-btn { width: 100%; padding: 15px; background: #2d3436; color: white; border: none; border-radius: 15px; font-weight: bold; cursor: pointer; font-size: 1.1rem; }
