/* =========================================================
   EduLabs – Trò chơi "Đi tìm kho báu" (tiền tố kb-)
   Sân khấu 1280×720 co giãn đều (engine-di-tim-kho-bau.js)
   ========================================================= */
.ge-stage .kb-host, .gp-host.kb-host { position: absolute; inset: 0; }
.kb-host [hidden] { display: none !important; }
.kb-host { position: relative; overflow: hidden; background: #0d3b2a; width: 100%; height: 100%; font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; user-select: none; -webkit-user-select: none; }
.kb-backdrop { position: absolute; inset: -40px; background: url(../games/kho-bau/bg-blur.jpg) center/cover; filter: blur(18px) brightness(.7); }
.kb-layer { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; overflow: hidden; }
.kb-scr { position: absolute; inset: 0; display: none; }
.kb-scr.on { display: block; }
.kb-loading { position: absolute; inset: 0; display: grid; place-items: center; background: #0d3b2a; color: #fff6d8; font-size: 26px; font-weight: 700; z-index: 9000; }

/* ---------- cảnh ---------- */
.kb-scene { position: absolute; inset: 0; overflow: hidden; isolation: isolate; }
.kb-bg { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; object-fit: cover; z-index: 0; }
.kb-objs, .kb-fxw { position: absolute; inset: 0; }
.kb-obj { position: absolute; pointer-events: none; transition: opacity .45s; }
.kb-obj.gone, .kb-glint.gone { opacity: 0; transform: scale(.6); transition: opacity .45s, transform .45s; }
.kb-obj.dimmed { filter: saturate(.5) brightness(.85); }
.kb-robot { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; }
.kb-rb-in { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.kb-pose { position: absolute; display: none; max-width: none; pointer-events: none; }
.kb-pose.on { display: block; }
.kb-shadow { position: absolute; left: 0; top: 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(30, 20, 5, .55), rgba(30, 20, 5, 0)); pointer-events: none; }
.kb-robot.kb-shake .kb-rb-in { animation: kbShake .5s 2; }
@keyframes kbShake { 0%, 100% { margin-left: 0 } 25% { margin-left: -7px } 75% { margin-left: 7px } }
.kb-robot.kb-breathe .kb-rb-in { animation: kbBreathe 2.4s ease-in-out infinite; }
@keyframes kbBreathe { 0%, 100% { margin-top: 0 } 50% { margin-top: -3px } }
.kb-bubble { position: absolute; left: 22px; top: -170px; width: 46px; height: 46px; border-radius: 50%; background: #fff; color: #e05d2a; font: 900 32px/46px "Be Vietnam Pro", sans-serif; text-align: center; box-shadow: 0 4px 10px rgba(0, 0, 0, .25); animation: kbPop .3s; }
@keyframes kbPop { from { transform: scale(.3); opacity: 0 } to { transform: scale(1); opacity: 1 } }

/* lấp lánh đánh dấu vật phẩm ẩn */
.kb-glint { position: absolute; width: 0; height: 0; pointer-events: none; }
.kb-glint i { position: absolute; left: calc(-14px * var(--s)); top: calc(-40px * var(--s)); width: calc(28px * var(--s)); height: calc(28px * var(--s));
  background: radial-gradient(closest-side, #fff 0, #fff6b0 35%, rgba(255, 214, 80, 0) 70%); clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); animation: kbTw 1.6s ease-in-out infinite; }
.kb-glint i:nth-child(2) { left: calc(8px * var(--s)); top: calc(-26px * var(--s)); transform: scale(.6); animation-delay: -.5s; }
.kb-glint i:nth-child(3) { left: calc(-30px * var(--s)); top: calc(-22px * var(--s)); transform: scale(.5); animation-delay: -1s; }
.kb-glint::after { content: ""; position: absolute; left: calc(-26px * var(--s)); top: calc(-8px * var(--s)); width: calc(52px * var(--s)); height: calc(16px * var(--s)); border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 236, 140, .75), rgba(255, 236, 140, 0)); animation: kbGlow 1.6s ease-in-out infinite; }
.kb-glint.big i { width: calc(40px * var(--s)); height: calc(40px * var(--s)); left: calc(-20px * var(--s)); top: calc(-52px * var(--s)); }
.kb-glint.kb-x::before { content: "✕"; position: absolute; left: calc(-18px * var(--s)); top: calc(-24px * var(--s)); font: 900 calc(34px * var(--s))/1 "Be Vietnam Pro", sans-serif; color: #c9302c; text-shadow: 0 2px 0 #fff2c4; transform: scaleY(.6); }
@keyframes kbTw { 0%, 100% { opacity: .25; transform: scale(.55) rotate(0) } 50% { opacity: 1; transform: scale(1) rotate(45deg) } }
@keyframes kbGlow { 0%, 100% { opacity: .35 } 50% { opacity: 1 } }

.kb-dust { position: absolute; width: calc(26px * var(--s)); height: calc(16px * var(--s)); margin: calc(-10px * var(--s)) 0 0 calc(-13px * var(--s)); border-radius: 50%; background: radial-gradient(closest-side, rgba(236, 214, 170, .9), rgba(236, 214, 170, 0)); animation: kbDust .65s ease-out forwards; pointer-events: none; }
@keyframes kbDust { from { transform: translate(0, 0) scale(.5); opacity: 1 } to { transform: translate(var(--dx), var(--dy)) scale(1.8); opacity: 0 } }
.kb-splash { position: absolute; width: calc(150px * var(--s)); height: calc(46px * var(--s)); margin: calc(-23px * var(--s)) 0 0 calc(-75px * var(--s)); border-radius: 50%; border: calc(5px * var(--s)) solid rgba(255, 255, 255, .9); animation: kbSplash .85s ease-out forwards; pointer-events: none; }
@keyframes kbSplash { from { transform: scale(.3); opacity: 1 } to { transform: scale(1.4); opacity: 0 } }
.kb-spark { position: absolute; width: 18px; height: 18px; margin: -9px; background: #fff3a6; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: kbSpark 1s ease-out forwards; z-index: 950; pointer-events: none; }
.kb-spark.big { width: 30px; height: 30px; margin: -15px; background: #ffe36b; }
@keyframes kbSpark { from { transform: translate(0, 0) scale(.3); opacity: 1 } 70% { opacity: 1 } to { transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(90deg); opacity: 0 } }
.kb-rays { position: absolute; width: 0; height: 0; pointer-events: none; }
.kb-rays::before { content: ""; position: absolute; left: -260px; top: -260px; width: 520px; height: 520px; transform: scale(var(--s)); border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 233, 120, .75) 0 9deg, rgba(255, 233, 120, 0) 9deg 22deg); -webkit-mask: radial-gradient(closest-side, #000 20%, transparent 100%); mask: radial-gradient(closest-side, #000 20%, transparent 100%); animation: kbRays 6s linear infinite, kbIn .8s ease-out; }
.kb-rays::after { content: ""; position: absolute; left: -130px; top: -130px; width: 260px; height: 260px; transform: scale(var(--s)); border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 245, 190, .95), rgba(255, 210, 80, 0)); animation: kbIn .8s ease-out; }
@keyframes kbRays { to { rotate: 360deg } }
@keyframes kbIn { from { opacity: 0 } }
.kb-plate { position: absolute; width: calc(150px * var(--s)); height: calc(46px * var(--s)); margin: calc(-23px * var(--s)) 0 0 calc(-75px * var(--s)); border-radius: 50%; pointer-events: none; transition: all .5s; }
.kb-plate.on { background: radial-gradient(closest-side, rgba(255, 238, 140, .95), rgba(255, 200, 60, .35) 70%, rgba(255, 200, 60, 0)); box-shadow: 0 0 30px rgba(255, 220, 90, .8); }
.kb-glyph { position: absolute; width: 0; height: 0; z-index: 90; pointer-events: none; }
.kb-glyph::before { content: ""; position: absolute; left: -38px; top: -38px; width: 76px; height: 76px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 246, 170, .95), rgba(255, 210, 70, 0)); opacity: 0; transition: opacity .6s; }
.kb-glyph.on::before { opacity: 1; animation: kbGlow 1.8s ease-in-out infinite; }
.kb-door { position: absolute; overflow: hidden; pointer-events: none; }
.kb-door img { position: absolute; top: 0; height: 100%; width: 50.5%; transition: transform 1.25s cubic-bezier(.5, 0, .3, 1); }
.kb-door .kb-dpl { left: 0; }
.kb-door .kb-dpr { right: 0; }
.kb-door.open .kb-dpl { transform: translateX(-100%); }
.kb-door.open .kb-dpr { transform: translateX(100%); }
.kb-vine { transform-origin: 50% 0; transition: transform 1s, opacity 1s; animation: kbSway 3.5s ease-in-out infinite; }
.kb-vine.open { transform: rotate(-70deg) translateX(-40px); opacity: .0; animation: none; }
@keyframes kbSway { 0%, 100% { rotate: -3deg } 50% { rotate: 3deg } }
.kb-rise { animation: kbRise .6s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes kbRise { from { transform: translateY(26px) scale(.7); opacity: 0 } to { transform: none; opacity: 1 } }
.kb-pop { animation: kbPopUp .45s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes kbPopUp { from { transform: translateY(20px) scale(.3); opacity: 0 } }
.kb-bob { animation: kbBob 2.2s ease-in-out infinite; }
@keyframes kbBob { 0%, 100% { translate: 0 0 } 50% { translate: 0 -6px } }
.kb-glow { filter: drop-shadow(0 0 10px rgba(255, 230, 110, .95)); }
.kb-open { animation: kbOpen .5s cubic-bezier(.2, 1.6, .4, 1); transform-origin: 50% 100%; }
@keyframes kbOpen { from { transform: scale(.85, 1.15) } }
.kb-fly { position: absolute; width: 60px; height: 60px; object-fit: contain; z-index: 980; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .3)); }
.kb-play.kb-rumble .kb-scene { animation: kbRumble .12s linear 9; }
@keyframes kbRumble { 0%, 100% { transform: translate(0, 0) } 33% { transform: translate(-3px, 1px) } 66% { transform: translate(3px, -1px) } }
.kb-fade { position: absolute; inset: 0; background: radial-gradient(circle at 50% 55%, #1c4a33, #0a1f15); opacity: 0; pointer-events: none; transition: opacity .32s ease; z-index: 1100; }
.kb-fade.on { opacity: 1; }

/* ---------- HUD (gỗ + giấy da, dựng bằng CSS vì chưa có nhóm ảnh 14) ---------- */
.kb-hud { position: absolute; left: 0; top: 0; right: 0; height: 68px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 6px; z-index: 1200;
  background: linear-gradient(#7a4a22, #5b3416); border-bottom: 3px solid #e8b04a; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.kb-hud::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 3px, rgba(0, 0, 0, .04) 3px 7px); pointer-events: none; }
.kb-logo { height: 62px; width: auto; margin-top: 4px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.kb-pill { position: relative; z-index: 1; min-width: 92px; height: 50px; padding: 2px 12px; border-radius: 14px; background: linear-gradient(#fff4d2, #f2d9a0); border: 3px solid #b8792f;
  box-shadow: inset 0 -3px 0 rgba(150, 90, 30, .25); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #5b3416; line-height: 1; }
.kb-pill small { font-size: 14px; font-weight: 700; opacity: .8; }
.kb-pill b { font-size: 25px; font-weight: 800; margin-top: 2px; white-space: nowrap; }
.kb-p-time.warn { background: linear-gradient(#ffe0d6, #ffb6a0); border-color: #d2482a; animation: kbWarn .6s ease-in-out infinite alternate; }
@keyframes kbWarn { to { transform: scale(1.06) } }
.kb-pill.bump, .kb-slot.bump { animation: kbBump .5s; }
@keyframes kbBump { 40% { transform: scale(1.18) } }
.kb-inv { position: relative; z-index: 1; display: flex; gap: 4px; padding: 3px 8px; height: 54px; align-items: center; border-radius: 14px; background: rgba(40, 20, 6, .45); border: 2px solid rgba(232, 176, 74, .7); margin-left: 4px; }
.kb-slot { position: relative; width: 48px; height: 46px; display: grid; place-items: center; border-radius: 10px; background: radial-gradient(closest-side, rgba(255, 240, 200, .18), rgba(255, 240, 200, 0)); }
.kb-slot img { width: 40px; height: 40px; object-fit: contain; opacity: .3; filter: grayscale(.8); transition: all .3s; }
.kb-slot.got img { opacity: 1; filter: drop-shadow(0 0 6px rgba(255, 220, 100, .7)); }
.kb-slot b { position: absolute; right: -2px; bottom: -3px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px; background: #f7c548; color: #5b3416; font: 800 14px/20px "Be Vietnam Pro", sans-serif; text-align: center; display: none; }
.kb-slot.got b { display: block; }
.kb-route { position: relative; z-index: 1; display: flex; align-items: center; margin-left: auto; padding: 0 6px; }
.kb-route i { width: 12px; height: 4px; background: #c79a55; border-radius: 2px; }
.kb-rz { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff1cc; border: 2px solid #b8792f; color: #6b3f19; font: 800 14px/1 "Be Vietnam Pro", sans-serif; position: relative; }
.kb-rz.done { background: #73c34a; border-color: #2f7b22; color: #fff; }
.kb-rz.lock { background: #8e6a45; color: #f4dfb5; border-color: #5e3d1d; }
.kb-rz.cur { background: none; border: 0; }
.kb-rz.cur img { width: 34px; height: 42px; object-fit: contain; margin-top: -10px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); }
.kb-tools { position: relative; z-index: 1; display: flex; gap: 6px; }
.kb-tool { width: 42px; height: 42px; border-radius: 12px; border: 2px solid #f5cf75; background: linear-gradient(#3fa34d, #23722f); color: #fff; font: 700 18px/1 system-ui, sans-serif; cursor: pointer; box-shadow: 0 3px 0 #164d1e; }
.kb-tool:hover { filter: brightness(1.12); }
.kb-tool.kb-t-pause { background: linear-gradient(#f5a333, #d97813); box-shadow: 0 3px 0 #8c4a07; font-size: 15px; }
.kb-tool.kb-t-exit { background: linear-gradient(#e4574a, #b8301f); box-shadow: 0 3px 0 #74180c; }
.kb-tool.kb-t-fs { background: linear-gradient(#3a8ee0, #1f62b3); box-shadow: 0 3px 0 #123e74; }
.kb-mode { position: absolute; left: 6px; top: 72px; z-index: 1150; padding: 2px 10px; border-radius: 10px; font: 800 14px/20px "Be Vietnam Pro", sans-serif; color: #fff; }
.kb-mode.pr { background: #2f9a4a; }
.kb-mode.ch { background: #d1532b; }

/* ---------- khung câu hỏi (ảnh nhóm 12: ngắn / cao) ---------- */
.kb-q { position: absolute; left: 92px; right: 92px; top: 76px; min-height: 104px; z-index: 1150; display: flex; align-items: center; justify-content: center; padding: 26px 58px 22px;
  border-style: solid; border-width: 30px 44px 22px 44px; border-image: url(../games/kho-bau/q-short.webp) 40 60 30 60 fill / 30px 44px 22px 44px stretch; box-sizing: border-box;
  transition: transform .4s cubic-bezier(.3, 1.3, .5, 1), opacity .3s; }
.kb-q[data-tall="1"] { border-image-source: url(../games/kho-bau/q-tall.webp); }
.kb-qt { margin: -18px -36px -12px; color: #4a2a0e; font-size: var(--qf, 34px); font-weight: 700; line-height: 1.28; text-align: center; overflow-wrap: anywhere; }
.kb-qt img.kb-img { max-height: 120px; max-width: 360px; vertical-align: middle; border-radius: 8px; margin: 4px; }
.kb-play:not(.kb-qa-on) .kb-q { transform: translateY(-40px); opacity: 0; pointer-events: none; }
.kb-frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .82em; line-height: 1.05; margin: 0 .1em; }
.kb-frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 .15em; }
.kb-ov { text-decoration: overline; }

/* ---------- thẻ đáp án (ảnh nhóm 13: A xanh dương, B vàng, C xanh lá, D tím; sáng / đúng / sai) ---------- */
.kb-cards { position: absolute; left: 28px; right: 28px; top: 506px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; z-index: 1150; transition: transform .4s cubic-bezier(.3, 1.3, .5, 1), opacity .3s; }
.kb-play:not(.kb-qa-on) .kb-cards { transform: translateY(60px); opacity: 0; pointer-events: none; }
.kb-card { --img: url(../games/kho-bau/card-a.webp); position: relative; height: var(--ch, 94px); padding: 0; margin: 0; background: none; cursor: pointer; text-align: left;
  border-style: solid; border-width: calc(22px * var(--k, .78)) calc(75px * var(--k, .78)) calc(24px * var(--k, .78)) calc(118px * var(--k, .78));
  border-image: var(--img) 22 75 24 118 fill / calc(22px * var(--k, .78)) calc(75px * var(--k, .78)) calc(24px * var(--k, .78)) calc(118px * var(--k, .78)) stretch;
  display: flex; align-items: center; transition: transform .15s, opacity .25s, filter .25s; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .25)); box-sizing: border-box; }
.kb-c-a { --img: url(../games/kho-bau/card-a.webp); } .kb-c-b { --img: url(../games/kho-bau/card-b.webp); } .kb-c-c { --img: url(../games/kho-bau/card-c.webp); } .kb-c-d { --img: url(../games/kho-bau/card-d.webp); }
.kb-qa-on .kb-cards:not(.kb-lock) .kb-card:not(.tried):hover, .kb-card:focus-visible { transform: translateY(-3px) scale(1.01); outline: none; }
.kb-qa-on .kb-cards:not(.kb-lock) .kb-c-a:not(.tried):hover, .kb-c-a:focus-visible { --img: url(../games/kho-bau/card-a-hi.webp); }
.kb-qa-on .kb-cards:not(.kb-lock) .kb-c-b:not(.tried):hover, .kb-c-b:focus-visible { --img: url(../games/kho-bau/card-b-hi.webp); }
.kb-qa-on .kb-cards:not(.kb-lock) .kb-c-c:not(.tried):hover, .kb-c-c:focus-visible { --img: url(../games/kho-bau/card-c-hi.webp); }
.kb-qa-on .kb-cards:not(.kb-lock) .kb-c-d:not(.tried):hover, .kb-c-d:focus-visible { --img: url(../games/kho-bau/card-d-hi.webp); }
.kb-c-a.right { --img: url(../games/kho-bau/card-a-ok.webp) !important; } .kb-c-b.right { --img: url(../games/kho-bau/card-b-ok.webp) !important; }
.kb-c-c.right { --img: url(../games/kho-bau/card-c-ok.webp) !important; } .kb-c-d.right { --img: url(../games/kho-bau/card-d-ok.webp) !important; }
.kb-c-a.wrong { --img: url(../games/kho-bau/card-a-no.webp) !important; } .kb-c-b.wrong { --img: url(../games/kho-bau/card-b-no.webp) !important; }
.kb-c-c.wrong { --img: url(../games/kho-bau/card-c-no.webp) !important; } .kb-c-d.wrong { --img: url(../games/kho-bau/card-d-no.webp) !important; }
.kb-card.right { filter: drop-shadow(0 0 12px rgba(80, 220, 90, .85)); animation: kbBump .5s; }
.kb-card.wrong { animation: kbShake .4s 2; }
.kb-card.dim { opacity: .5; filter: saturate(.6); }
.kb-card.tried { cursor: not-allowed; }
.kb-card.key::after { content: "Đáp án đúng"; position: absolute; right: calc(-60px * var(--k, .78)); top: calc(-30px * var(--k, .78)); padding: 1px 8px; border-radius: 8px; background: #2f9a4a; color: #fff; font: 700 13px/18px system-ui, sans-serif; }
.kb-ct { display: block; width: 100%; color: #3d230b; font-size: var(--cf, 28px); font-weight: 700; line-height: 1.18; overflow-wrap: anywhere; max-height: calc(var(--ch, 94px) - 18px); padding-left: 4px; }
.kb-card.kb-long .kb-ct { line-height: 1.12; }
.kb-ct img.kb-img { max-height: 54px; vertical-align: middle; border-radius: 6px; }
.kb-cards.kb-lock .kb-card { cursor: default; }

/* ---------- thông báo, banner khu vực, nút câu tiếp ---------- */
.kb-msg { position: absolute; left: 50%; top: 200px; transform: translateX(-50%); z-index: 1300; padding: 8px 24px; border-radius: 22px; font: 800 26px/1.3 "Be Vietnam Pro", sans-serif; color: #fff; white-space: nowrap; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }
.kb-msg.in { animation: kbMsg .35s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes kbMsg { from { transform: translateX(-50%) scale(.6); opacity: 0 } }
.kb-m-ok { background: linear-gradient(#4cc35a, #2a8f37); }
.kb-m-no { background: linear-gradient(#f07250, #c9452a); }
.kb-m-info { background: linear-gradient(#3a8ee0, #1f62b3); font-size: 22px; }
.kb-banner { position: absolute; left: 50%; top: 150px; transform: translateX(-50%); z-index: 1300; min-width: 520px; padding: 14px 40px 16px; text-align: center; color: #4a2a0e;
  background: linear-gradient(#fff4d2, #f0d396); border: 5px solid #8a5323; border-radius: 22px; box-shadow: 0 10px 26px rgba(0, 0, 0, .35), inset 0 0 0 3px #f5cf75; }
.kb-banner small { display: block; font: 800 18px/1 "Be Vietnam Pro", sans-serif; color: #2f7b22; letter-spacing: .5px; }
.kb-banner b { display: block; font: 900 42px/1.15 "Be Vietnam Pro", sans-serif; color: #7a3e10; }
.kb-banner span { font: 700 21px/1.2 "Be Vietnam Pro", sans-serif; }
.kb-banner.in { animation: kbBan .45s cubic-bezier(.2, 1.4, .4, 1); }
.kb-banner.out { animation: kbBanOut .38s ease-in forwards; }
@keyframes kbBan { from { transform: translate(-50%, -30px) scale(.7); opacity: 0 } }
@keyframes kbBanOut { to { transform: translate(-50%, -30px) scale(.8); opacity: 0 } }
.kb-next { position: absolute; right: 30px; bottom: 30px; z-index: 1300; padding: 12px 26px; border-radius: 18px; border: 3px solid #f5cf75; background: linear-gradient(#3fa34d, #23722f); color: #fff; font: 800 24px/1 "Be Vietnam Pro", sans-serif; cursor: pointer; box-shadow: 0 4px 0 #164d1e; }

/* ---------- chọn đường ---------- */
.kb-choose { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 1300; padding: 14px 30px 12px; border-radius: 26px; text-align: center;
  background: linear-gradient(rgba(255, 244, 210, .96), rgba(240, 211, 150, .96)); border: 5px solid #8a5323; box-shadow: 0 10px 26px rgba(0, 0, 0, .35); animation: kbBan .45s cubic-bezier(.2, 1.4, .4, 1); }
.kb-choose.out { animation: kbBanOut .3s ease-in forwards; }
.kb-ch-t { display: block; font: 900 30px/1.2 "Be Vietnam Pro", sans-serif; color: #7a3e10; margin-bottom: 6px; }
.kb-ch-row { display: flex; gap: 34px; justify-content: center; }
.kb-ch { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; cursor: pointer; padding: 6px 10px; border-radius: 18px; transition: transform .15s, background .15s; }
.kb-ch:hover, .kb-ch.hl { transform: translateY(-4px) scale(1.06); background: rgba(255, 255, 255, .45); }
.kb-ch.sel { background: rgba(115, 195, 74, .45); transform: scale(1.1); }
.kb-ch.been { opacity: .55; }
.kb-ch-btn { width: 112px; height: 112px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .3)); }
.kb-ch span { font: 900 26px/1.1 "Be Vietnam Pro", sans-serif; color: #4a2a0e; }
.kb-ch small { font: 700 16px/1.1 "Be Vietnam Pro", sans-serif; color: #8a5323; }
.kb-ch-h { display: block; margin-top: 4px; font: 700 17px/1.2 "Be Vietnam Pro", sans-serif; color: #6b3f19; }

/* ---------- màn mở đầu, tạm dừng, ghi chú ---------- */
.kb-intro { position: absolute; inset: 0; z-index: 1400; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, rgba(10, 40, 25, .35), rgba(10, 40, 25, .7)); }
.kb-intro.out { animation: kbFadeOut .5s forwards; }
@keyframes kbFadeOut { to { opacity: 0 } }
.kb-ibox { width: 760px; padding: 6px 40px 26px; text-align: center; border-radius: 30px; background: linear-gradient(rgba(255, 244, 210, .97), rgba(240, 211, 150, .97)); border: 6px solid #8a5323; box-shadow: 0 14px 40px rgba(0, 0, 0, .45); animation: kbBan .55s cubic-bezier(.2, 1.4, .4, 1); }
.kb-ilogo { width: 400px; margin-top: -90px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35)); }
.kb-ibox p { margin: 6px 0 10px; font: 700 24px/1.3 "Be Vietnam Pro", sans-serif; color: #4a2a0e; }
.kb-iroute { display: flex; justify-content: center; align-items: center; gap: 6px; margin-bottom: 14px; }
.kb-iroute span { padding: 4px 12px; border-radius: 12px; background: #fff; border: 2px solid #c79a55; font: 800 18px/1.2 "Be Vietnam Pro", sans-serif; color: #6b3f19; }
.kb-iroute span.q { background: #8e6a45; color: #fff; }
.kb-iroute i { color: #8a5323; font-style: normal; font-weight: 900; }
.kb-start { padding: 14px 40px; border-radius: 22px; border: 4px solid #f5cf75; background: linear-gradient(#4cc35a, #23722f); color: #fff; font: 900 30px/1 "Be Vietnam Pro", sans-serif; cursor: pointer; box-shadow: 0 5px 0 #164d1e; animation: kbWarn .9s ease-in-out infinite alternate; }
.kb-ihint { display: block; margin-top: 14px; font: 700 17px/1.2 "Be Vietnam Pro", sans-serif; color: #6b3f19; }
.kb-pause { position: absolute; inset: 0; z-index: 5000; display: grid; place-items: center; background: rgba(10, 30, 20, .55); }
.kb-pbox { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 50px; border-radius: 26px; background: #fff4d2; border: 5px solid #8a5323; }
.kb-pbox b { font: 900 40px/1 "Be Vietnam Pro", sans-serif; color: #7a3e10; }
.kb-pbox span { font: 700 20px/1.2 "Be Vietnam Pro", sans-serif; color: #4a2a0e; }
.kb-resume { padding: 10px 30px; border-radius: 16px; border: 3px solid #f5cf75; background: linear-gradient(#4cc35a, #23722f); color: #fff; font: 800 24px/1 "Be Vietnam Pro", sans-serif; cursor: pointer; }
.kb-note { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 6000; padding: 8px 18px; border-radius: 12px; background: rgba(0, 0, 0, .75); color: #fff; font: 600 18px/1.3 system-ui, sans-serif; }
.kb-paused .kb-pose, .kb-paused .kb-glint i, .kb-paused .kb-vine, .kb-paused .kb-bob, .kb-paused .kb-rays::before { animation-play-state: paused !important; }

/* ---------- màn tổng kết (ảnh nhóm 15) ---------- */
.kb-sbg { position: absolute; inset: 0; width: 1280px; height: 720px; object-fit: cover; }
.kb-stitle { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; pointer-events: none; overflow: visible; z-index: 2; }
.kb-stitle text { font: 900 35px "Be Vietnam Pro", sans-serif; letter-spacing: .5px; }
.kb-stitle .kb-st-sh { fill: rgba(60, 25, 0, .45); stroke: rgba(60, 25, 0, .45); stroke-width: 6px; stroke-linejoin: round; }
.kb-stitle .kb-st-x { fill: #8a4512; stroke: #5e2a06; stroke-width: 5px; stroke-linejoin: round; paint-order: stroke; }
.kb-stitle .kb-st-f { fill: url(#kbStG); stroke: #6b330a; stroke-width: 3px; stroke-linejoin: round; paint-order: stroke; }
/* khung giấy da: tiêu đề phụ · 3 ô tổng · lưới 2×4 số liệu · thẻ vật phẩm · 4 nút (tránh hoa hai góc dưới) */
.kb-sbox { position: absolute; left: 100px; top: 146px; width: 600px; height: 486px; display: flex; flex-direction: column; justify-content: space-between; color: #4a2a0e; }
.kb-shead { display: flex; align-items: center; justify-content: center; gap: 12px; }
.kb-shead b { font: 900 29px/1.1 "Be Vietnam Pro", sans-serif; color: #7a3e10; white-space: nowrap; }
.kb-stars { flex: none; white-space: nowrap; }
.kb-stars span { font-size: 36px; color: #d6c3a0; display: inline-block; }
.kb-stars span.on { color: #f7b928; text-shadow: 0 2px 0 #b06d07; animation: kbStar .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes kbStar { from { transform: scale(0) rotate(-90deg) } }
.kb-total { display: grid; grid-template-columns: 128px 128px 1fr; gap: 10px; height: 76px; }
.kb-total > div { padding: 4px 12px; border-radius: 14px; background: rgba(255, 255, 255, .55); border: 2px solid #d3a564; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.kb-total small { font: 700 15px/1.1 "Be Vietnam Pro", sans-serif; color: #8a5323; }
.kb-total b { font: 900 33px/1.05 "Be Vietnam Pro", sans-serif; color: #7a3e10; }
.kb-total .kb-tier { flex-direction: row; justify-content: flex-start; gap: 10px; }
.kb-tier img { width: 54px; height: 50px; object-fit: contain; }
.kb-tier span { display: flex; flex-direction: column; align-items: flex-start; text-align: left; line-height: 1.15; }
.kb-tier span small { display: block; }
.kb-tier b { font-size: 19px; white-space: nowrap; letter-spacing: -.2px; }
.kb-slist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 32px; gap: 5px 12px; }
.kb-slist li { display: flex; justify-content: space-between; align-items: center; padding: 0 12px; border-radius: 10px; background: rgba(255, 255, 255, .45); font: 700 17px/1 "Be Vietnam Pro", sans-serif; white-space: nowrap; }
.kb-slist b { font-weight: 900; color: #7a3e10; }
.kb-slist b.ok { color: #2a8f37; } .kb-slist b.no { color: #c9452a; }
.kb-sinv { display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 12px; border-radius: 14px; background: rgba(255, 255, 255, .45); border: 2px dashed #d3a564; }
.kb-sinv small { flex: none; width: 92px; font: 800 15px/1.2 "Be Vietnam Pro", sans-serif; color: #8a5323; }
.kb-sinv > div { flex: 1; display: flex; flex-wrap: nowrap; justify-content: space-evenly; gap: 4px; align-items: center; }
.kb-sinv em { font: 600 16px/1 "Be Vietnam Pro", sans-serif; color: #8a5323; }
.kb-si { position: relative; width: 48px; height: 46px; display: grid; place-items: center; }
.kb-si img { width: 42px; height: 42px; object-fit: contain; }
.kb-si b { position: absolute; right: -6px; bottom: -4px; padding: 0 5px; border-radius: 9px; background: #f7c548; font: 800 13px/18px "Be Vietnam Pro", sans-serif; color: #5b3416; }
.kb-sbtn { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 0 90px 0 62px; }
.kb-sbtn .kb-wbtn { padding: 6px 6px; font-size: 16px; border-width: 2px; border-radius: 12px; white-space: nowrap; }
.kb-wbtn { padding: 6px 6px; font-size: 16px; border-width: 2px; border-radius: 12px; white-space: nowrap; }
.kb-wbtn { padding: 9px 10px; border-radius: 14px; border: 3px solid #f5cf75; background: linear-gradient(#4cc35a, #23722f); color: #fff; font: 800 19px/1.1 "Be Vietnam Pro", sans-serif; cursor: pointer; box-shadow: 0 3px 0 #164d1e; }
.kb-wbtn:hover { filter: brightness(1.1); }
.kb-wb2 { background: linear-gradient(#f5a333, #d97813); box-shadow: 0 3px 0 #8c4a07; }
.kb-wb3 { background: linear-gradient(#3a8ee0, #1f62b3); box-shadow: 0 3px 0 #123e74; }
.kb-wb4 { background: linear-gradient(#e4574a, #b8301f); box-shadow: 0 3px 0 #74180c; }
.kb-sfx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.kb-confetti { position: absolute; animation: kbFall linear forwards; }
@keyframes kbFall { to { transform: translateY(820px) rotate(540deg); } }
.kb-detail { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(10, 30, 20, .55); }
.kb-dbox { width: 1000px; max-height: 640px; display: flex; flex-direction: column; padding: 18px 26px; border-radius: 22px; background: #fff7e0; border: 5px solid #8a5323; }
.kb-dbox h3 { margin: 0 0 8px; font: 900 30px/1 "Be Vietnam Pro", sans-serif; color: #7a3e10; }
.kb-dbox ol { margin: 0; padding: 0 0 0 26px; overflow: auto; flex: 1; }
.kb-dbox li { position: relative; padding: 8px 110px 8px 6px; border-bottom: 1px dashed #d3a564; font: 600 18px/1.3 "Be Vietnam Pro", sans-serif; color: #4a2a0e; }
.kb-dq small { display: block; color: #8a5323; font-size: 14px; }
.kb-da { font-size: 16px; margin-top: 2px; }
.kb-da span, .kb-da em { display: block; color: #8a5323; }
.kb-dr { position: absolute; right: 6px; top: 12px; padding: 2px 10px; border-radius: 10px; background: #ccc; font: 800 15px/20px "Be Vietnam Pro", sans-serif; color: #fff; }
.kb-dr.ok { background: #2a8f37; } .kb-dr.no { background: #c9452a; } .kb-dr.to { background: #d97813; }
.kb-dact { text-align: right; margin-top: 10px; }
.kb-dact .kb-wbtn { width: auto; padding: 9px 30px; }

/* ---------- trang soạn (xem trước trực tiếp) ---------- */
.kb-edit .kb-tools { pointer-events: none; opacity: .6; }
.kb-edit .kb-card { cursor: default; }
