/* Làm đề, kết quả, nhiệm vụ, cài đặt */
.exam-card { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; text-align: center; }
.exam-card img { width: 6rem; height: 6rem; }
.chip.bonus { background: #f9e7b3; }
.section-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; margin-top: 0.3rem; }
.score { text-align: center; }
.score-num { display: block; font-family: var(--font-display); font-size: 4rem; font-weight: 800; line-height: 1.1; }
.reward-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: 0.6rem; margin: 0.6rem 0; }
.reward-tile { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; padding: 0.7rem 0.4rem; border: 2px dashed var(--panel-line); border-radius: 0.9rem; background: #ead9b4; text-align: center; font-size: 0.9rem; }
.reward-tile b { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; }
.push-down { margin-top: auto; }

.streak { display: flex; align-items: center; gap: 0.9rem; }
.streak h2 { font-size: 1.5rem; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.4rem; }
.day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; min-height: 3.6rem; border: 2px dashed var(--panel-line); border-radius: 0.8rem; background: #ead9b4; font-size: 0.8rem; font-weight: 800; }
.day b { font-size: 0.85rem; }
.day.is-on { border: 2px solid var(--green); background: #dce8cb; }
.quest { display: flex; flex-direction: column; gap: 0.5rem; }
.rewards { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.6rem; vertical-align: middle; }
.rew { display: inline-flex; align-items: center; gap: 0.2rem; font-family: var(--font-display); white-space: nowrap; }
.milestones { white-space: pre-line; line-height: 1.5; }
.chest-hint { line-height: 1.6; }
.chest-hint .rewards { margin: 0 0.4rem; }
.riddle-reward { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.riddle-gift { display: flex; align-items: center; justify-content: center; gap: 0.7rem; min-height: 4.5rem; padding: 0.4rem 1rem; border: 2px dashed var(--panel-line); border-radius: 0.9rem; background: #ead9b4; font: inherit; font-weight: 800; color: var(--ink, inherit); opacity: 0.7; }
.riddle-gift.is-ready { opacity: 1; cursor: pointer; border: 2px solid #e0a81c; background: #fff0b8; box-shadow: 0 0 1.1rem 0.15rem rgb(255 200 60 / 0.85); animation: done-pulse 0.9s ease-in-out infinite; }
.quests-tabs .btn { position: relative; }
.quests-tabs .dot { position: absolute; top: -0.35rem; right: -0.2rem; min-width: 1.4rem; height: 1.4rem; padding: 0 0.3rem; border-radius: 999px; background: #d9432c; color: #fff; font-family: var(--font-display); font-size: 0.85rem; line-height: 1.2rem; text-align: center; border: 2px solid #fff6e0; }
.quest .reward { font-family: var(--font-display); white-space: nowrap; }
.quest .bar { flex: 1; }
.nowrap { white-space: nowrap; }
.claim { min-height: 2.75rem; padding: 0.2rem 0.9rem; font-size: 1rem; }
.got { color: var(--green-deep); font-weight: 800; }
.chest { display: flex; align-items: center; gap: 0.8rem; }
.chest-ico { flex: none; display: grid; place-items: center; width: 4.5rem; height: 4.5rem; border: 2px dashed var(--panel-line); border-radius: 0.8rem; background: #ead9b4; }
.chest-ico img { width: 3.4rem; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin-top: 0.4rem; }
.opts .pill-btn { font-size: 0.9rem; padding-inline: 0.5rem; }

.settings-list { padding: 0.4rem 0.9rem; }
.setting { display: flex; align-items: center; gap: 0.8rem; min-height: 3.6rem; padding-block: 0.3rem; border-bottom: 1px solid #dac9a3; }
.setting:last-child { border: 0; }
.set-ico { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: #c9a170; border: 2px solid var(--panel-line); }
.set-ico img { width: 1.7rem; height: 1.7rem; }
.range { width: 8.5rem; accent-color: var(--green); height: 2.75rem; }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: 0ms !important; transition-duration: 0ms !important; }

/* Làm bài thi */
.quiz { display: flex; flex-direction: column; gap: 0.7rem; }
.quiz-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; font-family: var(--font-display); }
.quiz-bar { height: 0.55rem; border-radius: 1rem; background: #dac9a3; overflow: hidden; }
.quiz-bar i { display: block; height: 100%; background: var(--green); transition: width 300ms; }
.quiz-q { font-size: 1.15rem; font-weight: 800; line-height: 1.4; }
.quiz-img { display: block; max-width: 100%; max-height: 40vh; margin: 0.5rem auto; object-fit: contain; border-radius: 0.6rem; }
.quiz-options { display: grid; gap: 0.5rem; }
.opt { display: flex; align-items: center; gap: 0.6rem; min-height: 3rem; padding: 0.55rem 0.8rem; border: 2px solid var(--panel-line); border-radius: 0.8rem; background: #f6ecd2; text-align: left; font: inherit; cursor: pointer; }
.opt:disabled { cursor: default; }
.opt-letter { flex: none; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: #c9a170; color: #fff; }
.opt.right { background: #d4e8bf; border-color: var(--green-deep); }
.opt.wrong { background: #f3c6bd; border-color: #b33a2c; }
.quiz-explain { padding: 0.6rem 0.8rem; border-radius: 0.8rem; background: #fff5d6; border: 2px dashed var(--panel-line); }
.test-box { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.7rem; border: 2px dashed #b33a2c; border-radius: 0.9rem; background: #fbe9e4; }
.review p { margin: 0.15rem 0; }
.review-q { font-weight: 800; }
.review-bad { color: #b33a2c; }
.review-good { color: var(--green-deep); font-weight: 700; }

/* Dòng đỏ to: tính năng chưa phát triển xong (Hồ sơ, tab Thành tựu) */
.unfinished-banner {
  margin: 0; padding: 0.8rem 1rem; border: 3px solid #8f1d12; border-radius: 0.9rem;
  background: #fbe0da; color: #c4271a; text-align: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; line-height: 1.35;
}
.quests-tabs .btn { min-height: 2.75rem; }

/* Thành tựu */
.achv { display: flex; align-items: center; gap: 0.8rem; }
.achv-cup { flex: none; }
.achv h2 { font-size: 1.1rem; }
.achv-reward { font-weight: 800; color: var(--green-deep); font-size: 0.9rem; margin-top: 0.2rem; }
.achv-chest { flex: none; width: 4rem; min-height: 3.6rem; padding: 0.2rem; }
.achv-chest img { width: 2.6rem; height: 2.6rem; }
.achv-chest.is-ready { animation: done-pulse 0.9s ease-in-out infinite; }
.achv.tier-hidden { border-color: #5a1a1a; background: #3a2226; color: #ffe1db; }
.achv.tier-hidden .muted { color: #e2b6ae; }
.achv.is-claimed { opacity: 0.85; }
.achv-note, .achievements .chip.bonus { white-space: normal; text-align: center; line-height: 1.3; }

/* Hồ sơ / avatar */
.avatar { position: relative; display: inline-grid; place-items: center; flex: none; border-radius: 50%; overflow: hidden; background: #f3e6cf; border: 3px solid #8d6a43; box-sizing: border-box; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.frame-vang { border-color: #f2b92c; box-shadow: 0 0 0 2px #7a5a12, 0 0 10px #ffd447; }
.frame-tim { border-color: #a566e8; box-shadow: 0 0 0 2px #4a2680, 0 0 10px #c79bff; }
.frame-cau_vong { border: 4px solid transparent; background: linear-gradient(#f3e6cf, #f3e6cf) padding-box, conic-gradient(#ff4d4d, #ffe34d, #58d86a, #3fb6ff, #c35bff, #ff4d4d) border-box; animation: frame-hue 3s linear infinite; }
.frame-den_do { border-color: #c2262e; box-shadow: 0 0 0 2px #14090c, 0 0 12px #c2262e; }
@keyframes frame-hue { to { filter: hue-rotate(360deg); } }
.home-profile { position: absolute; z-index: 2; top: calc(var(--space-2) + var(--safe-top)); left: calc(var(--space-2) + var(--safe-left)); display: block; }
.grade-seg { grid-template-columns: repeat(3, 1fr); align-items: center; }
.grade-seg .grade-title { grid-column: 1 / -1; font-family: var(--font-display); }
.grade-box { text-align: center; display: grid; gap: 0.8rem; }
.profile-preview { display: flex; align-items: center; gap: 1rem; }
.profile-tabs { grid-template-columns: repeat(4, 1fr); gap: 0.35rem; }
.profile-tabs .btn { min-height: 2.75rem; padding-inline: 0.2rem; font-size: 0.85rem; }
.profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.item { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 0.5rem 0.3rem; border: 2px solid var(--panel-line); border-radius: 0.9rem; background: var(--panel); text-align: center; font: inherit; cursor: pointer; }
.item b { font-family: var(--font-display); font-size: 0.85rem; line-height: 1.15; }
.item small { font-size: 0.72rem; line-height: 1.2; color: var(--ink-soft); font-weight: 700; }
.item.is-on { border-color: var(--green-deep); background: #dce8cb; }
.item.is-locked { background: #5a4636; border-color: #d3382a; color: #ffe1db; }
.item.is-locked small { color: #f0c9c0; }
.item.is-locked .item-art { filter: grayscale(1) brightness(.6); }
.item-art { display: grid; place-items: center; min-height: 4rem; }
.back-swatch { display: block; width: 2.8rem; }
.back-swatch .card-back { width: 100%; }
.card-back.back-tim img { filter: hue-rotate(250deg) saturate(1.2); }
.card-back.back-xanh img { filter: hue-rotate(150deg); }
.card-back.back-do img { filter: hue-rotate(-60deg) saturate(1.4); }
.fx-swatch { display: flex; gap: 0.15rem; }
.fx-swatch i { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #c9a170; transform: translateY(calc(var(--i) * -2px)); }
.fx-vang i { background: #ffd447; } .fx-tim i { background: #a566e8; } .fx-do_den i { background: #c2262e; }
.hero[data-frame='vang'] .hero-ring { border-color: #f2b92c; } .hero[data-frame='tim'] .hero-ring { border-color: #a566e8; }
.hero[data-frame='den_do'] .hero-ring { border-color: #c2262e; }
.hero[data-frame='cau_vong'] .hero-ring { border-color: #ffd23f; box-shadow: 0 0 12px #c35bff; animation: frame-hue 3s linear infinite; }
