/* =========================================================
   06 / 07 / 07.1 – Game EHS (câu hỏi, giải thích, hoàn thành)
   ========================================================= */
.game-main { position: relative; flex: 1; display: flex; flex-direction: column; }
.game-main::before {
  content: ''; position: absolute; left: 0; right: 0; top: -1.5rem; height: 49.5rem; z-index: -1; pointer-events: none;
  background: url('../images/bg-game.jpg') right top / 96rem 49.5rem no-repeat;
}
.main { position: relative; z-index: 0; }

.game { display: grid; grid-template-columns: 38.1rem 17.1rem; column-gap: 0.9rem; align-items: start; padding: 1.85rem 0 0 10.45rem; }

/* ----- Thẻ câu hỏi ----- */
.quiz { position: relative; background: #fff; border: 1px solid #e2e9f2; border-radius: 0.7rem; padding: 1.1rem 1.15rem 1.2rem; }
.quiz__top { display: flex; align-items: center; justify-content: space-between; height: 1.5rem; }
.quiz__counter { height: 1.5rem; padding: 0 0.9rem; border-radius: 0.75rem; background: #eaf2fb; display: inline-flex; align-items: center; gap: 0.2rem; white-space: nowrap; font-size: max(0.6rem, var(--fs-min, 0px)); font-weight: 600; line-height: 0.8rem; color: var(--navy); }
.quiz__percent { font-size: max(0.65rem, var(--fs-min, 0px)); font-weight: 500; line-height: 0.85rem; color: var(--muted-2); }
.quiz__track { margin-top: 0.8rem; height: 0.45rem; border-radius: 0.225rem; background: #e2e9f2; overflow: hidden; }
.quiz__bar { height: 100%; border-radius: 0.225rem; background: var(--green); transition: width .5s ease; }
.quiz__topic { margin-top: 1.55rem; font-size: max(0.6rem, var(--fs-min, 0px)); font-weight: 700; line-height: 0.8rem; color: var(--green); text-transform: uppercase; }
.quiz__media { margin: 1.25rem 0 0; width: 19.6rem; height: 11.9rem; border-radius: 0.7rem; overflow: hidden; }
.quiz__media img { width: 100%; height: 100%; object-fit: cover; }
.quiz__media--wide { width: 24.8rem; height: 13.9rem; border-radius: 1.1rem; }
.quiz__question { margin-top: 1.1rem; font-size: 1.3rem; font-weight: 500; line-height: 1.75rem; color: var(--navy); }

/* Câu hỏi dạng ghép cột/bảng (field WYSIWYG "ehs_q_table_html") - thay cho .quiz__question */
.quiz__question-table { margin-top: 1.1rem; font-size: 0.85rem; line-height: 1.3rem; color: var(--navy); overflow-x: auto; }
.quiz__question-table p { margin: 0 0 0.5rem; font-weight: 600; }
.quiz__question-table p:last-child { margin-bottom: 0; }
.quiz__question-table table { width: 100%; min-width: 26rem; border-collapse: collapse; font-weight: 400; }
.quiz__question-table th, .quiz__question-table td { border: 1px solid #e2e9f2; padding: 0.4rem 0.55rem; text-align: left; vertical-align: top; }
.quiz__question-table th { background: #eaf2fb; font-weight: 600; }

.quiz__hint { margin-top: 0.7rem; font-size: max(0.7rem, var(--fs-min2, 0px)); line-height: 0.95rem; color: var(--muted-2); }

.answers { margin-top: 1.1rem; display: grid; gap: 0.6rem; }
.answers--grid { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.answer {
  display: flex; align-items: center; gap: 0.85rem; width: 100%; min-height: 3.2rem; padding: 0.55rem 0.7rem;
  background: #fff; border: 1px solid #e2e9f2; border-radius: 0.7rem; text-align: left;
  font-size: 0.75rem; font-weight: 500; line-height: 1rem; color: #172b48;
  transition: background-color .2s, border-color .2s, color .2s, transform .15s;
}
.answers--grid .answer { min-height: 4rem; font-weight: 600; }
.answer:not(:disabled):hover { border-color: #b9cbe2; background: #f6f9fd; }
.answer:disabled { cursor: default; }
.answer__badge { width: 2rem; height: 2rem; flex: none; border-radius: 50%; background: #eaf2fb; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; line-height: 1rem; color: var(--navy); transition: background-color .2s, color .2s; }
.answer.is-selected { background: #eaf2fb; }
.answer.is-selected .answer__badge { background: var(--navy); color: #fff; }
.answer.is-wrong { background: #fff1f4; border-color: var(--danger); color: var(--danger); }
.answer.is-wrong .answer__badge { background: var(--danger); color: #fff; }
.answer.is-correct { background: #e5f7ea; border-color: var(--green); color: var(--green); }
.answer.is-correct .answer__badge { background: var(--green); color: #fff; }
.answer.is-correct.shake, .answer.is-wrong.shake { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.015); } }


.quiz__actions { display: flex; justify-content: flex-end; align-items: center; gap: 0.8rem; margin-top: 1rem; }
.quiz__next-note { font-size: max(0.65rem, var(--fs-min, 0px)); color: var(--muted-2); }
.quiz__confirm { width: 12.2rem; height: 2.4rem; font-size: 0.75rem; font-weight: 600; line-height: 1rem; }
.quiz__confirm:disabled { background: #b8c4d1; box-shadow: none; cursor: not-allowed; }

/* ----- Cột phải ----- */
.game-aside { display: flex; flex-direction: column; gap: 0.65rem; margin-top: -0.15rem; }
.side-card { position: relative; background: #fff; border: 1px solid #e2e9f2; border-radius: 0.7rem; }
.session { height: 11.4rem; }
.session__icon { position: absolute; left: 0.9rem; top: 0.9rem; width: 1.45rem; height: 1.45rem; }
.session__label { position: absolute; left: 0.85rem; top: 3.1rem; font-size: max(0.6rem, var(--fs-min, 0px)); font-weight: 700; line-height: 0.8rem; color: var(--muted-2); }
.session__time { position: absolute; left: 0.85rem; top: 4.2rem; font-size: 2.25rem; font-weight: 700; line-height: 3rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.session__desc { position: absolute; left: 0.85rem; top: 7.25rem; width: 15.2rem; font-size: max(0.6rem, var(--fs-min, 0px)); line-height: 0.8rem; color: var(--muted-2); }
.session__status { position: absolute; left: 0.85rem; top: 8.9rem; height: 1.5rem; padding: 0 0.8rem; border-radius: 0.75rem; background: #e5f7ea; display: grid; place-items: center; font-size: max(0.6rem, var(--fs-min, 0px)); font-weight: 600; line-height: 0.8rem; color: var(--green); }

.rules { padding: 0.85rem 0.85rem 0; height: 11.25rem; }
.rules__title { font-size: 0.95rem; font-weight: 600; line-height: 1.25rem; color: var(--navy); }
.rules__row { display: flex; align-items: center; gap: 0.65rem; height: 2.65rem; border-bottom: 1px solid #e2e9f2; font-size: max(0.7rem, var(--fs-min2, 0px)); line-height: 0.95rem; }
.rules__row:first-of-type { margin-top: 0.15rem; }
.rules__row img { width: 1.05rem; height: 1.05rem; }
.rules__row span { flex: 1; font-weight: 500; color: var(--muted-2); }
.rules__row b { font-weight: 600; color: var(--navy); }
.rules__foot { margin-top: 1rem; text-align: center; font-size: max(0.65rem, var(--fs-min, 0px)); line-height: 0.85rem; color: var(--muted-2); }

.footer--game { padding: 3rem 8.35rem 2rem 6.5rem; margin: 0; }

/* ----- Popup hoàn thành (07.1) ----- */
.result { width: 22.4rem; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 0.8rem; overflow: hidden; box-shadow: 0 1.25rem 2.5rem -0.6rem rgba(0, 0, 0, .25); }
.result__head { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 1.2rem; background: var(--navy); text-align: center; }
.result__trophy { width: 3.2rem; height: 3.2rem; border-radius: 50%; background: #ffb900; display: grid; place-items: center; box-shadow: 0 0.5rem 0.75rem -0.15rem rgba(0, 0, 0, .1), 0 0.2rem 0.3rem -0.2rem rgba(0, 0, 0, .1); }
.result__trophy img { width: 1.6rem; height: 1.6rem; }
.result__title { font-size: 1rem; font-weight: 500; line-height: 1.4rem; letter-spacing: -.46px; color: #fff; }
.result__sub { font-size: max(0.6rem, var(--fs-min, 0px)); line-height: 0.8rem; color: #bedbff; }
.result__body { display: flex; flex-direction: column; gap: 0.775rem; padding: 1.2rem; }
.result__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.result__stat { padding: 0.6rem; background: #f8fafc; border: 1px solid var(--line); border-radius: 0.6rem; text-align: center; }
.result__stat span { display: block; font-size: max(0.6rem, var(--fs-min, 0px)); line-height: 0.8rem; color: #62748e; }
.result__stat b { display: block; font-size: 1rem; font-weight: 500; line-height: 1.4rem; letter-spacing: -.46px; color: var(--ink-3); }
.result__score { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.8rem; background: rgba(239, 246, 255, .7); border: 1px solid #bedbff; border-radius: 0.6rem; }
.result__row { display: flex; justify-content: space-between; font-size: max(0.6rem, var(--fs-min, 0px)); line-height: 0.8rem; color: #314158; }
.result__row b { font-weight: 500; color: #1c398e; }
.result__total { display: flex; justify-content: space-between; align-items: center; padding-top: 0.4rem; border-top: 1px solid #bedbff; }
.result__total span { font-size: max(0.7rem, var(--fs-min2, 0px)); font-weight: 500; line-height: 1rem; letter-spacing: -.154px; color: var(--ink-3); }
.result__total b { font-size: 1rem; font-weight: 500; line-height: 1.4rem; letter-spacing: -.46px; color: var(--navy); }
.result__actions { display: flex; justify-content: center; gap: 0.4rem; padding-top: 0.425rem; }
.result__btn { display: flex; align-items: center; justify-content: center; gap: 0.3rem; width: 9.8rem; height: 1.9rem; border-radius: 5rem; font-size: max(0.6rem, var(--fs-min, 0px)); font-weight: 500; line-height: 0.8rem; transition: background-color .2s, box-shadow .2s; }
.result__btn img { width: 0.8rem; height: 0.8rem; }
.result__btn--outline { border: 1px solid #cad5e2; color: #314158; }
.result__btn--outline:hover { background: #f1f5f9; }
.result__btn--primary { width: 9.7rem; height: 2rem; background: var(--navy); color: #fff; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .05)); }
.result__btn--primary:hover { background: #002c4b; }
.result__btn--primary:disabled { background: #94a3b8; cursor: not-allowed; }

.page-bg::before, .game-main::before { -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
