/* =========================================================
   EduLabs – Trò chơi "Giải mã mật thư" (tiền tố lớp: mt-)
   Sân khấu 1280×720 co giãn đều · ảnh ở assets/games/mat-thu/
   ========================================================= */
.ge-stage .mt-host, .gp-host.mt-host { position: absolute; inset: 0; }
.mt-host [hidden] { display: none !important; }
.mt-host img { max-width: none; }
.mt-host { position: relative; overflow: hidden; background: #2a1238; width: 100%; height: 100%; font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; user-select: none; -webkit-user-select: none; }
.mt-backdrop { position: absolute; inset: -40px; background: url(../games/mat-thu/bg-blur.jpg) center/cover; filter: blur(18px) brightness(.55); }
.mt-layer { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; overflow: hidden; }
.mt-scr { position: absolute; inset: 0; display: none; }
.mt-scr.on { display: block; }
.mt-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #ffe7a0; font: 700 26px/1 "Be Vietnam Pro", sans-serif; background: #2a1238; z-index: 5000; }

/* ---------- cảnh ---------- */
.mt-bg { position: absolute; left: -64px; top: -72px; width: 1408px; height: 792px; object-fit: cover; transition: opacity .5s; }
.mt-bg.b { opacity: 0; }
.mt-vign { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 55%, transparent 55%, rgba(30, 8, 40, .45) 100%); }
.mt-objs { position: absolute; inset: 0; }
.mt-it { position: absolute; pointer-events: none; filter: drop-shadow(0 6px 5px rgba(40, 10, 0, .45)); transition: opacity .4s, transform .5s; }
.mt-it.in { animation: mtPop .5s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes mtPop { from { transform: scale(.3); opacity: 0 } }

/* robot thám tử: 8 tư thế (ảnh nhóm 2), khung cắt ngang mép bàn */
.mt-robot { position: absolute; left: 0; top: 0; width: 396px; height: 430px; z-index: 300; pointer-events: none; overflow: hidden; }
.mt-rbin { position: absolute; left: 0; top: 40px; width: 100%; height: 430px; transform-origin: 50% 100%; }
.mt-rp { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .18s; filter: drop-shadow(0 6px 8px rgba(20, 0, 30, .35)); }
.mt-robot[data-pose="idle"] .mt-rp-idle, .mt-robot[data-pose="inspect"] .mt-rp-inspect, .mt-robot[data-pose="thinking"] .mt-rp-thinking,
.mt-robot[data-pose="reading"] .mt-rp-reading, .mt-robot[data-pose="discover"] .mt-rp-discover, .mt-robot[data-pose="foundKey"] .mt-rp-foundKey,
.mt-robot[data-pose="openLetter"] .mt-rp-openLetter, .mt-robot[data-pose="celebrate"] .mt-rp-celebrate { opacity: 1; }
.mt-rshadow { position: absolute; width: 150px; height: 26px; border-radius: 50%; background: radial-gradient(rgba(30, 8, 0, .5), transparent 70%); z-index: 299; pointer-events: none; }
.mt-robot[data-pose="idle"] .mt-rbin { animation: mtBob 2.6s ease-in-out infinite; }
.mt-robot[data-pose="inspect"] .mt-rbin { animation: mtLean 1.3s ease-in-out infinite; }
.mt-robot[data-pose="thinking"] .mt-rbin { animation: mtSway 2s ease-in-out infinite; }
.mt-robot[data-pose="reading"] .mt-rbin { animation: mtBob 3s ease-in-out infinite; }
.mt-robot[data-pose="discover"] .mt-rbin { animation: mtHop .5s ease-out 1; }
.mt-robot[data-pose="foundKey"] .mt-rbin { animation: mtHop .6s ease-out 1; }
.mt-robot[data-pose="openLetter"] .mt-rbin { animation: mtHop .5s ease-out 1; }
.mt-robot[data-pose="celebrate"] .mt-rbin { animation: mtJump .7s ease-in-out infinite; }
@keyframes mtBob { 50% { transform: translateY(-5px) } }
@keyframes mtLean { 50% { transform: rotate(-2.5deg) translateX(-4px) } }
@keyframes mtSway { 25% { transform: rotate(-1.6deg) } 75% { transform: rotate(1.6deg) } }
@keyframes mtHop { 40% { transform: translateY(-20px) scaleY(1.03) } 70% { transform: translateY(0) scaleY(.97) } }
@keyframes mtJump { 0%, 100% { transform: translateY(0) scaleY(1) } 15% { transform: translateY(0) scaleY(.95) } 50% { transform: translateY(-22px) } }
.mt-paused * { animation-play-state: paused !important; }

/* ---------- bảng mật mã ---------- */
.mt-board { position: absolute; z-index: 200; transform-origin: 50% 100%; }
.mt-board > .mt-bimg { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 10px 10px rgba(40, 10, 0, .5)); }
.mt-board.unroll { animation: mtUnroll .9s cubic-bezier(.3, 1.2, .5, 1); }
@keyframes mtUnroll { from { clip-path: inset(0 48% 0 48%); } to { clip-path: inset(0 0 0 0); } }
.mt-bhead { position: absolute; left: 0; right: 0; top: 7%; display: flex; justify-content: center; align-items: center; gap: 10px; z-index: 3; }
.mt-bpage { padding: 1px 10px; border-radius: 10px; background: #5a2a8a; color: #ffe7a0; font: 800 13px/20px "Be Vietnam Pro", sans-serif; }
.mt-prog { position: relative; width: 46%; height: 28px; }
.mt-prog > img { position: absolute; inset: 0; width: 100%; height: 100%; }
.mt-prog i { position: absolute; left: 11%; top: 34%; height: 32%; width: 0; max-width: 78%; border-radius: 6px; background: linear-gradient(#fff3b0, #f2b928 60%, #c98a10); box-shadow: 0 0 8px #ffd54a; transition: width .6s; }
.mt-prog b { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 800 12.5px/1 "Be Vietnam Pro", sans-serif; text-shadow: 0 1px 2px #2a0a40, 0 0 3px #2a0a40; }
.mt-cells { position: absolute; left: 9.5%; right: 9.5%; top: 20%; bottom: 13%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: var(--rg, 6px); z-index: 2; }
.mt-line { display: flex; justify-content: center; gap: var(--wg, 18px); }
.mt-word { display: flex; gap: var(--cg, 3px); }
.mt-cell { position: relative; width: var(--cs, 50px); height: calc(var(--cs, 50px) * 1.12); perspective: 400px; }
.mt-cell .mt-f2 { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .55s cubic-bezier(.4, 1.5, .5, 1); display: grid; place-items: center; }
.mt-cell .mt-cf { background: url(../games/mat-thu/tile-purple.webp) center/100% 100% no-repeat; }
.mt-cell .mt-cb { background: url(../games/mat-thu/tile-cream.webp) center/100% 100% no-repeat; transform: rotateY(180deg); }
.mt-cell .mt-cb::after { content: ""; position: absolute; left: 50%; top: -30%; width: 42%; height: 42%; margin-left: -21%; background: url(../games/mat-thu/hud-check.webp) center/contain no-repeat; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); }
.mt-cell .mt-qm { position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 4%; color: #ffe08a; font: 900 calc(var(--cs, 50px) * .62)/1 "Be Vietnam Pro", sans-serif; text-shadow: 0 2px 0 #7a4a12, 0 0 6px rgba(255, 210, 90, .45); transition: opacity .2s; }
.mt-cell .mt-clk { position: absolute; left: 50%; bottom: 6%; width: 30%; margin-left: -15%; display: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.mt-board.locks .mt-cell .mt-clk { display: block; }
.mt-board.locks .mt-cell .mt-qm { padding-bottom: 34%; font-size: calc(var(--cs, 50px) * .52); }
.mt-cell .mt-symw { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.mt-cell.scan .mt-symw { opacity: 1; } .mt-cell.scan .mt-qm, .mt-cell.scan .mt-clk { opacity: 0; }
.mt-cell .mt-symw .mt-sym { filter: sepia(1) saturate(4) hue-rotate(5deg) brightness(1.4) drop-shadow(0 0 6px #ffd54a); }
.mt-cell.open .mt-cf { transform: rotateY(-180deg); }
.mt-cell.open .mt-cb { transform: rotateY(0); }
.mt-cell .mt-sym { width: 66%; height: 66%; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.mt-cell .mt-sym2 { display: flex; width: 86%; height: 86%; align-items: center; justify-content: center; }
.mt-cell .mt-sym2 img { width: 50%; height: 60%; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.mt-cell .mt-ch { color: #3d1a5a; font: 900 calc(var(--cs, 50px) * .62)/1 "Be Vietnam Pro", "Segoe UI", sans-serif; margin-top: calc(var(--cs, 50px) * .08); }
.mt-cell.just .mt-cb { background-image: url(../games/mat-thu/tile-gold.webp); filter: drop-shadow(0 0 10px #ffd54a); }
.mt-cell.just::after { content: ""; position: absolute; inset: -40%; background: url(../games/mat-thu/fx-ring.webp) center/contain no-repeat; animation: mtRing .9s ease-out forwards; pointer-events: none; }
@keyframes mtRing { from { transform: scale(.4); opacity: 1 } to { transform: scale(1.3); opacity: 0 } }
.mt-cell.word-ok .mt-cb { filter: drop-shadow(0 0 5px rgba(80, 220, 110, .9)); }
.mt-cell.told .mt-ch { color: #9a3b12; }
.mt-cell.hint .mt-cf { filter: brightness(1.25) drop-shadow(0 0 6px #ffd54a); }
.mt-cell.scan .mt-cf { filter: brightness(1.3) drop-shadow(0 0 8px #ffd54a); }
.mt-punct { width: calc(var(--cs, 50px) * .5); display: grid; place-items: center; color: #5a2a1a; font: 900 calc(var(--cs, 50px) * .7)/1 "Be Vietnam Pro", sans-serif; }
.mt-board.done .mt-bimg { filter: drop-shadow(0 0 22px #ffd54a) drop-shadow(0 10px 10px rgba(40, 10, 0, .5)); }
.mt-board.flip { animation: mtBflip .8s ease-in-out; }
@keyframes mtBflip { 50% { transform: rotateY(90deg) } }

/* phong thư + ổ khóa */
.mt-env { position: absolute; z-index: 210; transform-origin: 50% 100%; }
.mt-env img { position: absolute; left: 0; bottom: 0; width: 100%; filter: drop-shadow(0 8px 8px rgba(40, 10, 0, .5)); transition: opacity .35s; }
.mt-env .e2, .mt-env .e3, .mt-env .e0 { opacity: 0; }
.mt-env[data-st="closed"] .e1 { opacity: 0 } .mt-env[data-st="closed"] .e0 { opacity: 1 }
.mt-env[data-st="open"] .e1 { opacity: 0 } .mt-env[data-st="open"] .e2 { opacity: 1 }
.mt-env[data-st="letter"] .e1 { opacity: 0 } .mt-env[data-st="letter"] .e3 { opacity: 1 }
.mt-env.glow img { filter: drop-shadow(0 0 16px #ffd54a) drop-shadow(0 8px 8px rgba(40, 10, 0, .5)); }
.mt-env.shake { animation: mtShake .45s 2; }
.mt-lock { position: absolute; z-index: 220; transform-origin: 50% 20%; transition: opacity .5s, transform .8s cubic-bezier(.5, 0, .7, .4); }
.mt-lock img { position: absolute; left: 0; bottom: 0; width: 100%; filter: drop-shadow(0 6px 6px rgba(30, 0, 30, .5)); }
.mt-lock .l2 { opacity: 0; }
.mt-lock.open .l1 { opacity: 0 } .mt-lock.open .l2 { opacity: 1 }
.mt-lock.shake { animation: mtShake .35s 2; }
.mt-lock.drop { transform: translateY(160px) rotate(25deg); opacity: 0; }
.mt-lock.glow img { filter: drop-shadow(0 0 14px #ffd54a); }
@keyframes mtShake { 25% { transform: translateX(-5px) rotate(-3deg) } 75% { transform: translateX(5px) rotate(3deg) } }
.mt-fly { position: absolute; z-index: 1600; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .4)); }
.mt-glass { position: absolute; z-index: 1500; width: 120px; pointer-events: none; transform-origin: 30% 30%; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45)); }
.mt-glass.gold { filter: drop-shadow(0 0 14px #ffd54a) drop-shadow(0 0 30px #ffb300); }
.mt-fx { position: absolute; pointer-events: none; z-index: 1550; }
.mt-fx.burst { animation: mtBurst .9s ease-out forwards; }
@keyframes mtBurst { from { transform: scale(.3) rotate(0); opacity: 1 } to { transform: scale(1.4) rotate(40deg); opacity: 0 } }
.mt-spark { position: absolute; width: 10px; height: 10px; margin: -5px; z-index: 1560; pointer-events: none; background: radial-gradient(#fff, #ffd54a 40%, transparent 70%); animation: mtSpark 1s ease-out forwards; }
@keyframes mtSpark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0 } }
.mt-conf { position: absolute; top: -30px; width: 14px; height: 9px; z-index: 1700; pointer-events: none; animation: mtFall linear forwards; }
@keyframes mtFall { to { transform: translate(var(--dx), 800px) rotate(720deg); } }
.mt-wax { position: absolute; z-index: 1580; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(#e0414a, #8a1018); pointer-events: none; animation: mtWax .9s ease-out forwards; }
@keyframes mtWax { to { transform: translate(var(--dx), var(--dy)) rotate(200deg) scale(.5); opacity: 0 } }

/* ---------- HUD ---------- */
.mt-hud { position: absolute; left: 0; right: 0; top: 0; height: 72px; z-index: 1200; display: flex; align-items: center; gap: 7px; padding: 0 12px 0 8px; background: linear-gradient(rgba(40, 10, 60, .55), rgba(40, 10, 60, 0)); }
.mt-logo { height: 66px; width: auto; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .4)); }
.mt-logo-s { display: none; height: 60px; }
.mt-pill { position: relative; width: 170px; height: 50px; flex: none; }
.mt-pill > img { position: absolute; inset: 0; width: 100%; height: 100%; }
.mt-pill small { display: none; }
.mt-pill b { position: absolute; left: 62px; right: 12px; top: 0; bottom: 2px; display: flex; align-items: center; justify-content: center; color: #3b2412; font: 800 18px/1 "Be Vietnam Pro", sans-serif; white-space: nowrap; letter-spacing: -.01em; }

.mt-p-clue { width: 112px; } .mt-p-clue b { font-size: 20px; left: 56px; }
.mt-pill.warn b { color: #d02a2a; animation: mtPulse .5s infinite alternate; }
.mt-pill.bump { animation: mtBump .45s; }
@keyframes mtPulse { to { transform: scale(1.12) } }
@keyframes mtBump { 40% { transform: scale(1.14) } }
.mt-hsp { flex: 1; }
.mt-stage { flex: none; display: flex; align-items: center; gap: 6px; height: 50px; padding: 0 12px 0 6px; border-radius: 14px; background: linear-gradient(#5b2690, #3a1462); border: 2px solid #e2b04a; box-shadow: inset 0 0 0 1px #8a5bc4, 0 3px 6px rgba(20, 0, 30, .45); color: #fff3c8; white-space: nowrap; }
.mt-stage > img { height: 40px; width: auto; }
.mt-stage > div { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; max-width: 176px; }
.mt-stage small { color: #ffd54a; font: 800 13px/1.15 "Be Vietnam Pro", sans-serif; }
.mt-stn { flex-basis: 100%; font: 800 15px/1.2 "Be Vietnam Pro", sans-serif; overflow: hidden; text-overflow: ellipsis; }
.mt-mode { padding: 0 8px; border-radius: 9px; font: 800 11px/16px "Be Vietnam Pro", sans-serif; color: #fff; display: inline-block; }
.mt-mode.pr { background: #2f9a4a; } .mt-mode.ch { background: #c2410c; }
.mt-tools { display: flex; gap: 5px; flex: none; }
.mt-tool { width: 46px; height: 46px; padding: 0; border: 0; background: none; cursor: pointer; transition: transform .15s; }
.mt-tool img { width: 100%; height: 100%; pointer-events: none; }
.mt-tool:hover, .mt-tool:focus-visible { transform: scale(1.08); outline: none; }

/* ---------- khung câu hỏi ---------- */
.mt-q { position: absolute; left: 66px; right: 66px; top: 78px; min-height: 108px; z-index: 1150; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  padding: 14px 44px; border-radius: 22px; border: 4px solid #c8952f;
  background: radial-gradient(ellipse at 50% 40%, #fbf0d6 0%, #f3e0b4 62%, #e6c88e 100%);
  box-shadow: inset 0 0 0 3px #f9ecc8, inset 0 0 0 5px #b07a26, inset 0 0 26px rgba(150, 95, 30, .35), 0 0 0 2px #7a4a12, 0 8px 14px rgba(30, 5, 40, .45);
  transition: transform .4s cubic-bezier(.3, 1.3, .5, 1), opacity .3s; }
.mt-q::before, .mt-q::after { content: ""; position: absolute; top: 50%; width: 14px; height: 14px; margin-top: -7px; background: linear-gradient(135deg, #fff1b8, #d9a640 55%, #9a6a1a); border: 1.5px solid #7a4a12; transform: rotate(45deg); }
.mt-q::before { left: 14px; } .mt-q::after { right: 14px; }
.mt-qt { color: #3b2412; font-size: var(--qf, 34px); font-weight: 800; line-height: 1.27; text-align: center; overflow-wrap: anywhere; }
.mt-qt img.mt-img { max-height: 118px; max-width: 360px; vertical-align: middle; border-radius: 8px; margin: 4px; }
.mt-play:not(.mt-qa-on) .mt-q { transform: translateY(-40px); opacity: 0; pointer-events: none; }
.mt-frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .82em; line-height: 1.05; margin: 0 .1em; }
.mt-frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 .15em; }
.mt-ov { text-decoration: overline; }

/* ---------- thẻ đáp án ---------- */
.mt-cards { position: absolute; left: 26px; right: 26px; top: 518px; 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; }
.mt-play:not(.mt-qa-on) .mt-cards { transform: translateY(70px); opacity: 0; pointer-events: none; }
.mt-card { --img: url(../games/mat-thu/card-a.webp); --k: .62; position: relative; height: var(--ch, 94px); padding: 0; margin: 0; background: none; cursor: pointer; text-align: left; box-sizing: border-box;
  border-style: solid; border-width: calc(26px * var(--k)) calc(96px * var(--k)) calc(28px * var(--k)) calc(132px * var(--k));
  border-image: var(--img) 26 96 28 132 fill / calc(26px * var(--k)) calc(96px * var(--k)) calc(28px * var(--k)) calc(132px * var(--k)) stretch;
  display: flex; align-items: center; transition: transform .15s, opacity .25s, filter .25s; filter: drop-shadow(0 4px 4px rgba(30, 0, 40, .35)); }
.mt-c-a { --img: url(../games/mat-thu/card-a.webp); } .mt-c-b { --img: url(../games/mat-thu/card-b.webp); } .mt-c-c { --img: url(../games/mat-thu/card-c.webp); } .mt-c-d { --img: url(../games/mat-thu/card-d.webp); }
.mt-qa-on .mt-cards:not(.mt-lock) .mt-card:not(.tried):hover, .mt-card:focus-visible { transform: translateY(-3px) scale(1.01); outline: none; filter: drop-shadow(0 0 10px rgba(255, 213, 74, .95)) drop-shadow(0 4px 4px rgba(30, 0, 40, .35)); }
.mt-c-a.right { --img: url(../games/mat-thu/card-a-ok.webp) !important; } .mt-c-b.right { --img: url(../games/mat-thu/card-b-ok.webp) !important; }
.mt-c-c.right { --img: url(../games/mat-thu/card-c-ok.webp) !important; } .mt-c-d.right { --img: url(../games/mat-thu/card-d-ok.webp) !important; }
.mt-c-a.wrong { --img: url(../games/mat-thu/card-a-no.webp) !important; } .mt-c-b.wrong { --img: url(../games/mat-thu/card-b-no.webp) !important; }
.mt-c-c.wrong { --img: url(../games/mat-thu/card-c-no.webp) !important; } .mt-c-d.wrong { --img: url(../games/mat-thu/card-d-no.webp) !important; }
.mt-card.right { filter: drop-shadow(0 0 12px rgba(80, 220, 90, .9)); animation: mtBump .5s; }
.mt-card.wrong { animation: mtShake .4s 2; }
.mt-card.dim { opacity: .5; filter: saturate(.6); }
.mt-card.tried { cursor: not-allowed; }
.mt-card.key::after { content: "Đáp án đúng"; position: absolute; right: calc(-70px * var(--k)); top: calc(-34px * var(--k)); padding: 1px 8px; border-radius: 8px; background: #2f9a4a; color: #fff; font: 700 13px/18px system-ui, sans-serif; }
.mt-ct { display: block; width: 100%; color: #3d1a0b; font-size: var(--cf, 28px); font-weight: 700; line-height: 1.17; overflow-wrap: anywhere; max-height: calc(var(--ch, 94px) - 18px); padding-left: 6px; }
.mt-card.mt-long .mt-ct { line-height: 1.1; }
.mt-ct img.mt-img { max-height: 54px; vertical-align: middle; border-radius: 6px; }
.mt-cards.mt-lock .mt-card { cursor: default; }

/* ---------- thông báo, banner giai đoạn ---------- */
.mt-msg { position: absolute; left: 50%; top: 200px; transform: translateX(-50%); z-index: 1300; padding: 8px 26px; border-radius: 24px; font: 800 26px/1.3 "Be Vietnam Pro", sans-serif; color: #fff; white-space: nowrap; box-shadow: 0 6px 16px rgba(0, 0, 0, .35); border: 3px solid #ffd54a; }
.mt-msg.in { animation: mtMsg .35s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes mtMsg { from { transform: translateX(-50%) scale(.6); opacity: 0 } }
.mt-m-ok { background: linear-gradient(#3fb15a, #23803a); } .mt-m-no { background: linear-gradient(#e0574a, #b02a22); } .mt-m-info { background: linear-gradient(#7a3fc0, #4f1f8a); } .mt-m-gold { background: linear-gradient(#f4b91c, #c07a08); color: #3d1a00; }
.mt-banner { position: absolute; left: 50%; top: 290px; z-index: 1400; transform: translateX(-50%); min-width: 560px; padding: 18px 46px 20px; text-align: center; border-radius: 22px;
  background: linear-gradient(#6a2fa8, #3e1670); border: 4px solid #e8b53a; box-shadow: 0 0 0 3px #7a4a10, 0 16px 40px rgba(0, 0, 0, .5); color: #fff; }
.mt-banner small { display: block; color: #ffd54a; font: 800 16px/1.3 "Be Vietnam Pro", sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.mt-banner b { display: block; font: 900 40px/1.2 "Be Vietnam Pro", sans-serif; text-shadow: 0 3px 0 #2a0a40; }
.mt-banner span { display: block; margin-top: 4px; color: #f6e6ff; font: 600 19px/1.35 "Be Vietnam Pro", sans-serif; }
.mt-banner.in { animation: mtBan .5s cubic-bezier(.3, 1.4, .5, 1); }
.mt-banner.out { transition: opacity .35s, transform .35s; opacity: 0; transform: translateX(-50%) translateY(-30px); }
@keyframes mtBan { from { transform: translateX(-50%) scale(.5); opacity: 0 } }
.mt-next { position: absolute; right: 30px; top: 440px; z-index: 1350; padding: 12px 26px; border: 3px solid #ffd54a; border-radius: 26px; background: linear-gradient(#7a3fc0, #4f1f8a); color: #fff; font: 800 22px/1 "Be Vietnam Pro", sans-serif; cursor: pointer; box-shadow: 0 6px 14px rgba(0, 0, 0, .35); }

/* chuyển cảnh */
.mt-fade { position: absolute; inset: 0; z-index: 1900; background: #1a0624; opacity: 0; pointer-events: none; transition: opacity .32s; }
.mt-fade.on { opacity: 1; }
.mt-light { position: absolute; inset: 0; z-index: 1900; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 50%, #fffbe6, #ffe08a 35%, rgba(255, 200, 60, .6) 60%, rgba(255, 190, 40, 0) 100%); transition: opacity .35s; }
.mt-light.on { opacity: 1; }

/* ---------- màn mở đầu ---------- */
.mt-intro { position: absolute; inset: 0; z-index: 1800; display: grid; place-items: center; background: radial-gradient(rgba(30, 8, 50, .25), rgba(20, 4, 34, .78)); }
.mt-intro.out { transition: opacity .5s; opacity: 0; }
.mt-ibox { width: 780px; text-align: center; color: #fff; }
.mt-ilogo { width: 520px; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .5)); animation: mtFloat 3s ease-in-out infinite; }
.mt-ibox p { margin: 4px auto 14px; max-width: 720px; font: 600 22px/1.45 "Be Vietnam Pro", sans-serif; text-shadow: 0 2px 4px rgba(0, 0, 0, .7); }
.mt-isteps { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 0 0 18px; flex-wrap: wrap; }
.mt-isteps span { padding: 4px 12px; border-radius: 14px; background: rgba(90, 40, 140, .85); border: 2px solid #e8b53a; font: 700 14px/1.2 "Be Vietnam Pro", sans-serif; }
.mt-isteps i { color: #ffd54a; font-style: normal; }
.mt-start { padding: 16px 44px; border: 4px solid #ffe08a; border-radius: 34px; background: linear-gradient(#ffcc33, #e08a00); color: #3d1a00; font: 900 28px/1 "Be Vietnam Pro", sans-serif; cursor: pointer; box-shadow: 0 0 0 4px #7a4a10, 0 10px 24px rgba(0, 0, 0, .45); animation: mtPulse2 1.6s ease-in-out infinite; }
@keyframes mtPulse2 { 50% { transform: scale(1.05) } }
.mt-ihint { display: block; margin-top: 14px; color: #f0dcff; font: 600 15px/1.3 "Be Vietnam Pro", sans-serif; }

/* ---------- suy luận cuối cùng ---------- */
.mt-guess { position: absolute; left: 70px; right: 70px; top: 508px; z-index: 1350; padding: 14px 24px 16px; border-radius: 20px; background: linear-gradient(rgba(74, 30, 120, .96), rgba(44, 14, 78, .96)); border: 4px solid #e8b53a; box-shadow: 0 0 0 3px #7a4a10, 0 14px 30px rgba(0, 0, 0, .5); color: #fff; text-align: center; }
.mt-guess.in { animation: mtBan2 .45s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes mtBan2 { from { transform: translateY(60px); opacity: 0 } }
.mt-guess h3 { margin: 0 0 8px; font: 900 24px/1.2 "Be Vietnam Pro", sans-serif; color: #ffd54a; }
.mt-grow { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.mt-ginput { width: 520px; padding: 10px 16px; border-radius: 14px; border: 3px solid #e8b53a; background: #fff8e6; color: #3d1a5a; font: 800 24px/1.2 "Be Vietnam Pro", sans-serif; text-transform: uppercase; outline: none; user-select: text; -webkit-user-select: text; }
.mt-gbtn { padding: 10px 18px; border-radius: 14px; border: 3px solid #ffe08a; background: linear-gradient(#ffcc33, #e08a00); color: #3d1a00; font: 800 17px/1.1 "Be Vietnam Pro", sans-serif; cursor: pointer; }
.mt-gbtn.b2 { background: linear-gradient(#9b6ae0, #6a35b8); color: #fff; border-color: #d6b8ff; }
.mt-gbtn.b3 { background: linear-gradient(#3fb15a, #23803a); color: #fff; border-color: #b9f0c4; }
.mt-gbtn.b4 { background: linear-gradient(#e0574a, #a8231b); color: #fff; border-color: #ffc2b8; }
.mt-gbtn[disabled] { opacity: .45; cursor: not-allowed; }
.mt-gmsg { min-height: 22px; margin-top: 8px; font: 700 17px/1.3 "Be Vietnam Pro", sans-serif; color: #ffe7a0; }
.mt-gmsg.no { color: #ffb4a8; } .mt-gmsg.ok { color: #b9f0c4; }

/* ---------- tiết lộ thông điệp ---------- */
.mt-reveal { position: absolute; inset: 0; z-index: 1450; pointer-events: none; }
.mt-roll { position: absolute; width: 90px; z-index: 1460; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .5)); }
.mt-letter { position: absolute; left: 34px; right: 372px; top: 92px; height: 524px; z-index: 1470; pointer-events: auto; transform-origin: 50% 50%; }
.mt-letter > img { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 16px 30px rgba(0, 0, 0, .55)); }
.mt-letter.unroll { animation: mtUnroll 1.3s cubic-bezier(.3, 1, .5, 1); }
.mt-lin { position: absolute; left: 16%; right: 16%; top: 13%; bottom: 13%; display: flex; flex-direction: column; align-items: center; justify-content: safe center; text-align: center; overflow: auto; color: #3d1a0b; }
.mt-lin small { color: #7a3fc0; font: 800 15px/1.3 "Be Vietnam Pro", sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.mt-lttl { flex: none; font: 900 32px/1.1 "Be Vietnam Pro", sans-serif; text-transform: uppercase; letter-spacing: .02em; color: #c58a1e; background: linear-gradient(#ffe48a, #e0a83a 48%, #a8670f); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 2px 0 #6a3a08) drop-shadow(0 0 1px #6a3a08); }
.mt-ldiv { flex: none; position: relative; width: 78%; height: 34px; margin: 2px 0 2px; display: grid; place-items: center; }
.mt-ldiv::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: linear-gradient(90deg, transparent, #c8952f 15%, #c8952f 42%, transparent 46%, transparent 54%, #c8952f 58%, #c8952f 85%, transparent); }
.mt-ldiv img { position: relative; height: 32px; width: auto; filter: drop-shadow(0 0 6px #ffd54a); }
.mt-lkw { flex: none; margin: 0 0 6px; color: #5a1f8a; font: 900 19px/1.2 "Be Vietnam Pro", sans-serif; letter-spacing: .03em; }
.mt-lkw small { color: #8a5a2a; font-weight: 700; letter-spacing: 0; }
.mt-lseal { flex: none; display: block; width: 46px; height: 46px; margin-top: 10px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #e34a4a, #a3161c 60%, #6e0c10); box-shadow: 0 0 0 4px rgba(163, 22, 28, .35), 0 3px 4px rgba(0, 0, 0, .35); position: relative; }
.mt-lseal::after { content: "✦"; position: absolute; inset: 0; display: grid; place-items: center; color: #f5c66a; font-size: 20px; }
.mt-ltx { color: #3b2412; font: 800 var(--lf, 30px)/1.38 "Be Vietnam Pro", sans-serif; white-space: pre-wrap; }
.mt-ltx .w { opacity: 0; transition: opacity .3s; } .mt-ltx .w.on { opacity: 1; }
.mt-limg { flex: none; max-width: 60%; max-height: 150px; margin-top: 10px; border-radius: 10px; border: 3px solid #e8b53a; }
.mt-lact { position: absolute; left: 0; right: 0; bottom: -74px; display: flex; justify-content: center; gap: 12px; }

/* ---------- tạm dừng, ghi chú ---------- */
.mt-pause { position: absolute; inset: 0; z-index: 2500; display: grid; place-items: center; background: rgba(20, 4, 34, .6); }
.mt-pbox { padding: 28px 46px; border-radius: 22px; background: linear-gradient(#6a2fa8, #3e1670); border: 4px solid #e8b53a; text-align: center; color: #fff; }
.mt-pbox b { display: block; font: 900 40px/1.2 "Be Vietnam Pro", sans-serif; }
.mt-pbox span { display: block; margin: 6px 0 16px; font: 600 18px/1.3 "Be Vietnam Pro", sans-serif; color: #f0dcff; }
.mt-note { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 2600; padding: 8px 18px; border-radius: 12px; background: rgba(20, 4, 34, .88); color: #fff; font: 600 16px/1.3 "Be Vietnam Pro", sans-serif; }
.mt-wbtn { padding: 11px 20px; border-radius: 16px; border: 3px solid #ffe08a; background: linear-gradient(#ffcc33, #e08a00); color: #3d1a00; font: 800 17px/1.1 "Be Vietnam Pro", sans-serif; cursor: pointer; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); }
.mt-wbtn.v { background: linear-gradient(#9b6ae0, #6a35b8); color: #fff; border-color: #d6b8ff; }
.mt-wbtn.g { background: linear-gradient(#3fb15a, #23803a); color: #fff; border-color: #b9f0c4; }
.mt-wbtn.r { background: linear-gradient(#e0574a, #a8231b); color: #fff; border-color: #ffc2b8; }
.mt-wbtn:hover, .mt-wbtn:focus-visible { transform: translateY(-2px); outline: none; filter: brightness(1.06); }

/* ---------- màn tổng kết (ảnh nhóm 12) ---------- */
.mt-sbg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* chữ "Kết quả giải mã" uốn cong theo băng rôn, nổi khối 3D (thầy góp ý 2026-11-28) */
.mt-stitle { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; pointer-events: none; overflow: visible; z-index: 2; }
.mt-stitle text { font: 900 36px "Be Vietnam Pro", sans-serif; letter-spacing: .5px; }
.mt-stitle .mt-st-sh { fill: rgba(40, 0, 60, .45); stroke: rgba(40, 0, 60, .45); stroke-width: 6px; stroke-linejoin: round; }
.mt-stitle .mt-st-x { fill: #5a1490; stroke: #3a0862; stroke-width: 5px; stroke-linejoin: round; paint-order: stroke; }
.mt-stitle .mt-st-f { fill: url(#mtStG); stroke: #4a0a78; stroke-width: 3px; stroke-linejoin: round; paint-order: stroke; }
.mt-sbox { position: absolute; left: 66px; top: 150px; width: 700px; height: 488px; display: flex; flex-direction: column; justify-content: space-between; color: #3d1a0b; z-index: 2; padding: 4px 0 2px; box-sizing: border-box; }
.mt-shead { display: flex; align-items: center; justify-content: center; gap: 14px; }
.mt-stars span { font-size: 42px; color: #d7c3a0; text-shadow: 0 2px 0 #8a6a40; }
.mt-stars span.on { color: #ffc21a; text-shadow: 0 2px 0 #a86c12, 0 0 12px #ffd54a; animation: mtPop .5s backwards; }
.mt-shead b { font: 900 25px/1.2 "Be Vietnam Pro", sans-serif; color: #5a1f8a; }
.mt-skw { margin: 6px auto 6px; display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 12px; max-width: 660px; }
.mt-skw .mt-word { gap: 2px; }
.mt-skw .mt-cell { --cs: var(--scs, 44px); }
.mt-skw .mt-cell .mt-f2 { transition: none; }
.mt-sres { text-align: center; font: 800 20px/1.3 "Be Vietnam Pro", sans-serif; }
.mt-sres em { font-style: normal; padding: 2px 12px; border-radius: 12px; color: #fff; }
.mt-sres em.ok { background: #2f9a4a; } .mt-sres em.mid { background: #7a3fc0; } .mt-sres em.no { background: #c2410c; }
.mt-sgrid { margin: 0 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.mt-sgrid div { padding: 9px 4px 10px; border-radius: 12px; background: rgba(255, 255, 255, .55); border: 2px solid #e2c48a; text-align: center; }
.mt-sgrid small { display: block; color: #7a4a1a; font: 700 12.5px/1.2 "Be Vietnam Pro", sans-serif; }
.mt-sgrid b { display: block; font: 900 28px/1.15 "Be Vietnam Pro", sans-serif; color: #3d1a5a; }
.mt-sgrid b.ok { color: #23803a; } .mt-sgrid b.no { color: #c2311b; }
.mt-sbtn { display: flex; justify-content: center; gap: 9px; flex-wrap: wrap; }
.mt-sbtn .mt-wbtn { font-size: 16px; padding: 10px 15px; }
.mt-ov2 { position: absolute; inset: 0; z-index: 30; background: rgba(20, 4, 34, .7); display: grid; place-items: center; }
.mt-dbox { width: 1060px; max-height: 640px; display: flex; flex-direction: column; padding: 20px 26px; border-radius: 20px; background: #fff8e6; border: 4px solid #e8b53a; color: #3d1a0b; }
.mt-dbox h3 { margin: 0 0 10px; font: 900 26px/1.2 "Be Vietnam Pro", sans-serif; color: #5a1f8a; }
.mt-dbox ol { margin: 0; padding: 0 6px 0 30px; overflow: auto; flex: 1; }
.mt-dbox li { padding: 8px 0; border-bottom: 1px dashed #d8bf8a; position: relative; padding-right: 110px; font: 600 17px/1.35 "Be Vietnam Pro", sans-serif; }
.mt-dbox li small { display: block; color: #7a4a1a; font-size: 13px; }
.mt-dbox li .r { position: absolute; right: 0; top: 10px; padding: 2px 10px; border-radius: 10px; background: #888; color: #fff; font: 800 14px/20px sans-serif; }
.mt-dbox li .r.ok { background: #2f9a4a; } .mt-dbox li .r.no { background: #c2311b; } .mt-dbox li .r.to { background: #b06a00; }
.mt-dbox .mt-dact { margin-top: 12px; display: flex; justify-content: center; gap: 10px; }
.mt-sum .mt-letter { top: 70px; }

/* trang soạn: xem trước tĩnh */
.mt-edit .mt-card { cursor: default; }
.mt-edit .mt-tools { pointer-events: none; }

/* ---------- cột thiết lập (tao-game.html) ---------- */
.mt-set [hidden] { display: none !important; }
.mt-set .t { margin-top: 10px; }
.mt-set textarea.ge-input { width: 100%; resize: vertical; font: inherit; line-height: 1.4; }
.mt-kprev { margin-top: 8px; padding: 8px; border-radius: 10px; background: #3e1670; display: flex; flex-wrap: wrap; gap: 3px 10px; justify-content: center; }
.mt-kprev .mt-word { gap: 2px; }
.mt-kprev .mt-cell { --cs: 22px; }
.mt-kprev .mt-cell .mt-f2 { transition: none; }
.mt-kprev .mt-punct { color: #ffe7a0; }
.mt-kinfo { margin-top: 6px; font-size: 12.5px; line-height: 1.4; color: var(--text-muted, #6b7280); }
.mt-kinfo b { color: var(--text, #1f2937); }
.mt-kinfo.err { color: #c2311b; }
.mt-krow { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.mt-krow .btn-md { padding: 6px 12px; font-size: 13px; }
.mt-mimg { margin-top: 6px; max-width: 100%; max-height: 110px; border-radius: 8px; border: 1px solid var(--border, #e5e7eb); display: block; }
.mt-sw { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.mt-sw > div { flex: 1; font-size: 14px; }
.mt-sw small { display: block; color: var(--text-muted, #6b7280); font-size: 12px; }
.mt-play.letter-on .mt-board { opacity: 0; transition: opacity .4s; }

/* cảnh mở khóa và thư (theo ảnh mẫu) */
.mt-board.away { opacity: 0; transform: scale(.9) translateY(20px); transition: opacity .5s, transform .5s; pointer-events: none; }
.mt-env.mv, .mt-lock.mv { transition: left .7s cubic-bezier(.3, 1.1, .5, 1), top .7s cubic-bezier(.3, 1.1, .5, 1), width .7s, height .7s, opacity .5s, transform .8s; }
.mt-env.shine::before { content: ""; position: absolute; left: -45%; right: -45%; top: -95%; bottom: -10%; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 50% 60%, #fff 0, rgba(255, 248, 200, .98) 14%, rgba(255, 214, 100, .75) 30%, rgba(255, 180, 60, .3) 48%, transparent 66%); animation: mtShine 2.4s ease-in-out infinite alternate; }
.mt-env.shine::after { content: ""; position: absolute; left: -30%; right: -30%; top: -80%; height: 190%; z-index: -1; pointer-events: none; background: url(../games/mat-thu/fx-burst.webp) center/contain no-repeat; opacity: .85; animation: mtRays 9s linear infinite; }
@keyframes mtRays { to { transform: rotate(360deg) } }
@keyframes mtShine { from { opacity: .8; transform: scale(.96) } to { opacity: 1; transform: scale(1.04) } }
.mt-play.letter-on .mt-env, .mt-play.letter-on .mt-lock, .mt-play.letter-on .mt-keyhang { opacity: 0; transition: opacity .4s; }
.mt-lgo { min-width: 220px; padding: 12px 34px !important; border-radius: 30px !important; font-size: 26px !important; background: linear-gradient(#8a4fd6, #5b2596 60%, #45197a) !important; color: #fff !important; border: 3px solid #f2c75a !important; box-shadow: 0 0 0 2px #6a3a08, 0 6px 12px rgba(20, 0, 30, .5) !important; }
