* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f2f5;
    color: #222;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
}

body.dark {
    background-color: #0f1117;
    color: #e0e0e0;
}

/* 테마 토글 */
#theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #333;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    z-index: 100;
    transition: background-color 0.3s;
}
#theme-toggle:hover { background-color: #555; }
body.dark #theme-toggle { background-color: #f0f0f0; color: #333; }
body.dark #theme-toggle:hover { background-color: #ccc; }

/* 전체 레이아웃 */
.page-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* 헤더 */
header {
    text-align: center;
    margin-bottom: 40px;
}
header h1 {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -0.5px;
}
.header-sub {
    color: #888;
    margin-top: 8px;
    font-size: 15px;
}
body.dark .header-sub { color: #aaa; }

/* 게임 섹션 */
.game-section {
    background: #fff;
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    transition: background-color 0.3s, box-shadow 0.3s;
}
body.dark .game-section {
    background: #1a1d2e;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.question-badge {
    display: inline-block;
    background: #007bff;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.question-title {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 32px;
    text-align: center;
}

/* 선택지 */
.choices {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.choice-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 20px;
    border: 3px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.2s;
    background-color: #f5f7fa;
    color: #222;
}
body.dark .choice-btn {
    background-color: #252840;
    color: #e0e0e0;
}

#btn-a { border-color: #e0e0e0; }
#btn-b { border-color: #e0e0e0; }
body.dark #btn-a,
body.dark #btn-b { border-color: #333; }

#btn-a:hover { border-color: #ff6b6b; background-color: #fff0f0; color: #cc0000; }
#btn-b:hover { border-color: #4dabf7; background-color: #f0f8ff; color: #0056b3; }
body.dark #btn-a:hover { background-color: #2e1a1a; border-color: #ff6b6b; color: #ff9999; }
body.dark #btn-b:hover { background-color: #1a2033; border-color: #4dabf7; color: #99ccff; }

#btn-a.selected { border-color: #ff6b6b; background-color: #ffe0e0; color: #cc0000; }
#btn-b.selected { border-color: #4dabf7; background-color: #ddeeff; color: #0056b3; }
body.dark #btn-a.selected { background-color: #2e1a1a; color: #ff9999; }
body.dark #btn-b.selected { background-color: #1a2033; color: #99ccff; }

.choice-btn.disabled { cursor: default; opacity: 0.6; }
.choice-btn.disabled:hover { background-color: #f5f7fa; color: #222; border-color: #e0e0e0; }
body.dark .choice-btn.disabled:hover { background-color: #252840; color: #e0e0e0; border-color: #333; }

.choice-label {
    font-size: 2rem;
    font-weight: 900;
    opacity: 0.3;
}
#btn-a .choice-label { color: #ff6b6b; opacity: 1; }
#btn-b .choice-label { color: #4dabf7; opacity: 1; }

.choice-text {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}

/* VS */
.vs {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 900;
    color: #ccc;
    padding: 0 16px;
    flex-shrink: 0;
}
body.dark .vs { color: #444; }

/* 결과 */
.result-section {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid #eee;
}
body.dark .result-section { border-top-color: #333; }

.result-title {
    font-size: 15px;
    font-weight: bold;
    color: #555;
    margin-bottom: 16px;
    text-align: center;
}
body.dark .result-title { color: #aaa; }

.result-bars { display: flex; flex-direction: column; gap: 12px; }

.result-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-label {
    width: 80px;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.bar-wrap {
    flex: 1;
    background-color: #eee;
    border-radius: 8px;
    height: 20px;
    overflow: hidden;
}
body.dark .bar-wrap { background-color: #2a2d3e; }

.bar {
    height: 100%;
    border-radius: 8px;
    width: 0%;
    transition: width 0.8s ease;
}
.bar-a { background: linear-gradient(90deg, #ff6b6b, #ff9999); }
.bar-b { background: linear-gradient(90deg, #4dabf7, #99ccff); }

.result-pct {
    width: 40px;
    font-size: 14px;
    font-weight: bold;
    text-align: right;
    flex-shrink: 0;
}

.my-vote {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: #888;
}
body.dark .my-vote { color: #aaa; }

.next-btn {
    display: block;
    margin: 20px auto 0;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}
.next-btn:hover { background-color: #0056b3; }

/* 진행 도트 */
.progress-wrap {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}
.progress-dots {
    display: flex;
    gap: 8px;
}
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ccc;
    transition: background-color 0.3s;
}
.dot.active { background-color: #007bff; }
.dot.done { background-color: #4CAF50; }
body.dark .dot { background-color: #444; }

/* 토론 섹션 */
.discussion-section {
    margin-top: 60px;
    background: #fff;
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    transition: background-color 0.3s, box-shadow 0.3s;
}
body.dark .discussion-section {
    background: #1a1d2e;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.discussion-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 6px;
}
.discussion-sub {
    color: #888;
    font-size: 14px;
    margin-bottom: 28px;
}
body.dark .discussion-sub { color: #aaa; }

/* 반응형 */
@media (max-width: 540px) {
    .choices { flex-direction: column; }
    .vs { padding: 12px 0; }
    .question-title { font-size: 1.2rem; }
    header h1 { font-size: 1.7rem; }
}
