/* 사자성어 퀴즈(2026-10-31 개발자3). 공용 /psych/style.css 위에 덮는다. 초성 퀴즈(chosung.css)와 같은 꼴, 색은 주황. 본문 14px 이상. */
.stage.iq { padding: 0 0 40px; }
.hidden { display: none !important; }
.iq-head { text-align: center; margin: 12px 16px 0; }
.iq-eyebrow { font-size: 14px; font-weight: 800; color: #D9480F; }
.iq-title { font-size: 30px; font-weight: 900; color: #111827; margin: 2px 0 0; letter-spacing: -0.02em; }
.iq-sub { font-size: 15px; line-height: 1.6; color: #4B5563; margin: 6px 0 0; word-break: keep-all; }

.iq-box { background: #fff; border: 1.5px solid #E5E7EB; border-radius: 22px; padding: 16px; margin: 16px 16px 0; }
.iq-box-title { font-size: 17px; font-weight: 900; color: #111827; margin-bottom: 10px; }
.iq-topics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.iq-topic { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; font-family: inherit; border: 0; border-radius: 18px; padding: 14px 12px;
    min-height: 112px; color: #fff; cursor: pointer; box-shadow: 0 5px 0 rgba(0,0,0,.12); -webkit-tap-highlight-color: transparent; }
.iq-topic:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.iq-topic .e { font-size: 30px; line-height: 1; }
.iq-topic .n { font-size: 17px; font-weight: 900; word-break: keep-all; }
.iq-topic .d { font-size: 14px; font-weight: 700; opacity: .92; line-height: 1.4; word-break: keep-all; }
.iq-topic .p { margin-top: auto; font-size: 13px; font-weight: 800; background: rgba(255,255,255,.22); border-radius: 999px; padding: 2px 8px; }
.iq-t0 { background: linear-gradient(135deg, #F59F00, #E8590C); }
.iq-t1 { background: linear-gradient(135deg, #4DABF7, #1971C2); }
.iq-t2 { background: linear-gradient(135deg, #FF6B6B, #C92A2A); }
.iq-t3 { background: linear-gradient(135deg, #38D9A9, #0C8599); }
.iq-t4 { background: linear-gradient(135deg, #9775FA, #6741D9); }
.iq-rule { font-size: 14px; color: #6B7280; margin: 12px 0 0; line-height: 1.6; word-break: keep-all; }
.iq-rule b { color: #D9480F; }

.iq-challenge { text-align: center; padding: 6px 0 4px; }
.iq-ch-badge { display: inline-block; font-size: 14px; font-weight: 900; color: #fff; background: #E8590C; border-radius: 999px; padding: 4px 12px; }
.iq-ch-title { font-size: 22px; font-weight: 900; color: #111827; margin-top: 10px; word-break: keep-all; }
.iq-ch-desc { font-size: 15px; color: #4B5563; margin: 6px 0 0; }
.iq-text-btn { display: block; margin: 10px auto 0; font-family: inherit; font-size: 14px; font-weight: 800; color: #6B7280; background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 6px; }

.iq-main { display: block; width: 100%; margin-top: 14px; font-family: inherit; font-size: 18px; font-weight: 900; color: #fff;
    background: linear-gradient(180deg, #FF922B, #E8590C); border: 0; border-radius: 16px; padding: 15px; cursor: pointer; box-shadow: 0 5px 0 #C2410C; }
.iq-main:active { transform: translateY(3px); box-shadow: 0 2px 0 #C2410C; }

/* 게임 */
.iq-game { position: relative; background: linear-gradient(180deg, #FFF4E6 0%, #fff 60%); border-color: #FFD8A8; transition: box-shadow .2s; }
.iq-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.iq-topic-chip { font-size: 14px; font-weight: 800; color: #D9480F; background: #fff; border: 1.5px solid #FFC078; border-radius: 999px; padding: 4px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.iq-progress { font-size: 15px; font-weight: 900; color: #111827; }
.iq-score { position: relative; font-size: 15px; font-weight: 900; color: #E8590C; }
.iq-plus { position: absolute; right: 0; top: -4px; font-style: normal; font-size: 18px; font-weight: 900; color: #2B8A3E; opacity: 0; pointer-events: none; }
.iq-plus.show { animation: iqPlus .9s ease-out; }
@keyframes iqPlus { 0% { opacity: 0; transform: translateY(6px) scale(.7); } 25% { opacity: 1; transform: translateY(-10px) scale(1.15); } 100% { opacity: 0; transform: translateY(-30px) scale(1); } }
.iq-timer-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.iq-timer { flex: 1; height: 10px; background: #E9ECEF; border-radius: 999px; overflow: hidden; }
.iq-timer i { display: block; height: 100%; width: 100%; background: #FD7E14; border-radius: 999px; transform-origin: left center; }
.iq-timer i.low { background: #FA5252; }
.iq-sec { flex-shrink: 0; min-width: 34px; text-align: right; font-size: 14px; font-weight: 900; color: #495057; }
.iq-combo { position: absolute; left: 50%; top: 58px; z-index: 3; white-space: nowrap; font-size: 20px; font-weight: 900; color: #fff; background: linear-gradient(135deg, #FF922B, #E8590C);
    border-radius: 999px; padding: 5px 16px; box-shadow: 0 4px 12px rgba(232,89,12,.35); opacity: 0; pointer-events: none; transform: translate(-50%, 0); }
.iq-combo.show { animation: iqCombo 1.2s ease-out; }
@keyframes iqCombo { 0% { opacity: 0; transform: translate(-50%, 16px) scale(.5); } 20% { opacity: 1; transform: translate(-50%, -4px) scale(1.2); } 35% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -10px); } }
.iq-game.good { animation: iqGood .6s ease-out; }
.iq-game.bad { animation: iqBad .5s ease-out; }
@keyframes iqGood { 0% { box-shadow: 0 0 0 0 rgba(43,138,62,0); } 30% { box-shadow: 0 0 0 6px rgba(43,138,62,.45); } 100% { box-shadow: 0 0 0 0 rgba(43,138,62,0); } }
@keyframes iqBad { 0% { box-shadow: 0 0 0 0 rgba(224,49,49,0); } 30% { box-shadow: 0 0 0 6px rgba(224,49,49,.45); } 100% { box-shadow: 0 0 0 0 rgba(224,49,49,0); } }
.iq-ask { text-align: center; font-size: 14px; font-weight: 800; color: #6B7280; margin-top: 16px; }
.iq-mean { font-size: 18px; font-weight: 800; color: #212529; line-height: 1.6; text-align: center; word-break: keep-all; background: #fff; border: 2px solid #FFD8A8; border-radius: 16px;
    padding: 14px 14px; margin: 8px 0 0; min-height: 58px; animation: iqPop .3s ease-out; }
.iq-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.iq-choice { font-family: inherit; font-size: 21px; font-weight: 900; color: #343A40; background: #fff; border: 2px solid #DEE2E6; border-radius: 16px; padding: 16px 6px;
    box-shadow: 0 4px 0 #DEE2E6; cursor: pointer; letter-spacing: 0.04em; -webkit-tap-highlight-color: transparent; animation: iqPop .3s ease-out backwards; }
.iq-choice:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #DEE2E6; }
.iq-choice:disabled { cursor: default; }
.iq-choice.ok { color: #fff; background: #2B8A3E; border-color: #2B8A3E; box-shadow: 0 4px 0 #1E6B2E; }
.iq-choice.no { color: #fff; background: #E03131; border-color: #E03131; box-shadow: 0 4px 0 #A51D1D; animation: iqShake .35s; }
.iq-choice.dim { opacity: .45; }
@keyframes iqShake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes iqPop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.iq-reveal { margin-top: 14px; text-align: center; background: #FFF9DB; border-radius: 14px; padding: 12px; animation: iqPop .3s ease-out; }
.iq-rv-word b { font-size: 22px; font-weight: 900; color: #212529; }
.iq-rv-word span { display: block; font-size: 20px; font-weight: 700; color: #495057; letter-spacing: 0.12em; margin-top: 2px; }
.iq-rv-msg { font-size: 16px; font-weight: 900; margin-top: 6px; }
.iq-rv-msg.ok { color: #2B8A3E; } .iq-rv-msg.no { color: #E03131; }
.iq-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.iq-sub-btn { display: block; width: 100%; font-family: inherit; font-size: 15px; font-weight: 800; color: #374151; background: #F8F9FA; border: 1.5px solid #E9ECEF; border-radius: 12px; padding: 12px 6px; cursor: pointer; }

/* 결과 */
#iqResult { text-align: center; }
.iq-res-emoji { font-size: 56px; line-height: 1.1; animation: iqPop .5s ease-out; }
.iq-res-title { display: inline-block; margin-top: 6px; font-size: 20px; font-weight: 900; color: #fff; background: linear-gradient(135deg, #FF922B, #E8590C); border-radius: 999px; padding: 5px 16px; box-shadow: 0 4px 0 #C2410C; }
.iq-res-big { font-size: 20px; font-weight: 800; color: #374151; margin-top: 6px; }
.iq-res-big b { font-size: 34px; font-weight: 900; color: #D9480F; }
.iq-res-score { font-size: 16px; font-weight: 800; color: #E8590C; margin-top: 4px; word-break: keep-all; line-height: 1.5; }
.iq-res-say { font-size: 15px; font-weight: 700; color: #4B5563; margin-top: 6px; word-break: keep-all; }
.iq-exam { display: block; margin-top: 12px; font-size: 15px; font-weight: 900; color: #1864AB; background: #E7F5FF; border-radius: 12px; padding: 12px; text-decoration: none; }
.iq-review { text-align: left; }
.iq-review summary { font-size: 15px; font-weight: 800; color: #374151; cursor: pointer; padding: 6px 0; }
.iq-review-list { margin: 6px 0 0; padding-left: 22px; }
.iq-review-list li { font-size: 15px; line-height: 1.6; margin-bottom: 8px; word-break: keep-all; }
.iq-review-list .mk { font-weight: 900; margin-right: 4px; }
.iq-review-list .mk.ok { color: #2B8A3E; } .iq-review-list .mk.no { color: #E03131; }
.iq-review-list .hj { color: #868E96; margin-left: 4px; }
.iq-review-list .x { display: block; font-size: 14px; color: #495057; margin-top: 2px; }
.iq-others { margin-top: 16px; text-align: left; }
.iq-others-title { font-size: 16px; font-weight: 900; color: #111827; margin-bottom: 8px; text-align: center; }
.iq-others-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.iq-others-row button { font-family: inherit; font-size: 14px; font-weight: 800; color: #374151; background: #F8F9FA; border: 1.5px solid #E9ECEF; border-radius: 12px; padding: 11px 6px; cursor: pointer; word-break: keep-all; }
.iq-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

/* 주제 소개 */
.iq-intro { color: #374151; }
.iq-intro:empty { display: none; }
.iq-intro-title { font-size: 18px; font-weight: 900; color: #111827; margin: 0 0 8px; }
.iq-intro p { font-size: 15px; line-height: 1.7; margin: 0 0 8px; word-break: keep-all; }
.iq-intro-meta { font-size: 14px !important; color: #6B7280; }
.iq-topic-links { list-style: none; margin: 0; padding: 0; }
.iq-topic-links li { padding: 10px 2px; border-top: 1px solid #F1F3F5; }
.iq-topic-links li:first-child { border-top: 0; }
.iq-topic-links a { font-size: 16px; font-weight: 900; color: #D9480F; text-decoration: none; }
.iq-topic-links span { display: block; font-size: 14px; color: #6B7280; margin-top: 2px; }

@media (prefers-reduced-motion: reduce) { .iq-choice, .iq-mean, .iq-reveal, .iq-game.good, .iq-game.bad, .iq-combo.show, .iq-plus.show, .iq-res-emoji { animation: none; } }
@media (max-width: 360px) { .iq-choice { font-size: 19px; padding: 14px 4px; } .iq-mean { font-size: 17px; } }
@media (min-width: 768px) {
    .stage.iq { max-width: 760px; }
    .iq-title { font-size: 36px; }
    .iq-topics { grid-template-columns: repeat(3, 1fr); }
}
