/* =========================================================
   EduLabs – Bộ soạn trò chơi (dùng chung cho mọi mẫu trò chơi)
   + khung trò chơi Bắn trứng + trình chơi / trình chiếu
   ========================================================= */

/* ---------- Bố cục trang: vừa khít màn hình, các cột cuộn độc lập ---------- */
body.ge-page { overflow: hidden; }
.ge-page .main { height: calc(100vh * var(--vz, 1)); }
.ge-page .content { padding: 4px 14px 12px 16px; gap: 10px; flex: 1; min-height: 0; }
.ge-page .topbar { gap: 14px; padding-left: 22px; white-space: nowrap; }
.ge-page .class-select { min-width: 140px; }
.ge-page .topbar .btn-md { height: 38px; font-size: 13.5px; font-weight: 500; padding: 0 14px; }
.ge-page .topbar .btn-md .icon { width: 18px; height: 18px; }
.ge-page .topbar-right { gap: 10px; }
.ge-page .bell { padding: 6px 6px; }
.ge-page .user span { font-size: 13px; }
.ge-doc { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1.4px solid var(--border);
  border-radius: 10px; color: var(--text-strong); background: #fff; min-width: 0; }
.ge-doc .icon { width: 20px; height: 20px; color: var(--brand-600); flex-shrink: 0; }
.ge-doc input { border: 0; outline: 0; font: inherit; color: inherit; width: 170px; font-size: 13.5px; background: transparent; min-width: 60px; }
.ge-doc button { border: 0; background: none; padding: 0; color: var(--text-strong); display: grid; }
.ge-saved { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px;
  background: #e3f6ea; color: #13853f; font-size: 12.5px; font-weight: 600; }
.ge-saved .icon { width: 18px; height: 18px; fill: #1fae55; stroke: #fff; }
.ge-saved.saving { background: #e8f0fe; color: var(--cta-500); }
.ge-saved.dirty { background: #fff3dc; color: #a35f00; }
.ge-saved.saving .icon, .ge-saved.dirty .icon { fill: none; stroke: currentColor; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-strong); margin: 0 0 -2px 4px; }
.crumb .icon { width: 18px; height: 18px; color: var(--brand-600); }
.crumb a:hover { color: var(--cta-500); }

.ge-main { display: grid; grid-template-columns: 236px minmax(0, 1fr) 300px; gap: 14px; flex: 1; min-height: 0; }
.ge-panel { background: #fff; border-radius: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-soft); min-height: 0; display: flex; flex-direction: column; }
.ge-ph { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; font-size: 16px; font-weight: 700; color: var(--text-strong); }
.ge-ph .icon { width: 22px; height: 22px; color: var(--text-strong); }
.ge-ph .cnt { font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--bg-soft); border-radius: 99px; padding: 2px 8px; }
.ge-ph .more { margin-left: auto; }
.ge-more { width: 32px; height: 28px; border: 0; background: none; border-radius: 7px; color: var(--text-strong); display: grid; place-items: center; cursor: pointer; }
.ge-more:hover { background: var(--bg-soft); }
.ge-more .icon { width: 20px; height: 20px; }

/* ---------- Cột trái: danh sách câu hỏi ---------- */
.ge-list .btn-import { margin: 0 12px 10px; height: 40px; font-size: 13.5px; border-radius: 10px; }
.ge-items { flex: 1; min-height: 60px; overflow-y: auto; padding: 0 8px; }
.ge-item { position: relative; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 4px 0 8px; border-radius: 10px;
  cursor: pointer; font-size: 13.5px; color: var(--text-strong); user-select: none; border: 1.5px solid transparent; }
.ge-item:hover { background: #f4f7fd; }
.ge-item.on { background: #eaf1fe; border-color: #c9dbfb; }
.ge-item .no { width: 26px; height: 26px; border-radius: 7px; background: #e3e8f1; color: #5a6680; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; flex-shrink: 0; }
.ge-item.on .no { background: var(--grad-cta); color: #fff; }
.ge-item .tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ge-item .tx.empty { color: var(--text-muted); font-style: italic; }
.ge-item .warn { width: 18px; height: 18px; flex-shrink: 0; color: #e0475f; }
.ge-item .warn.soft { color: #e69a00; }
.ge-item.dragging { opacity: .4; }
.ge-item.drop-before::before, .ge-item.drop-after::after { content: ""; position: absolute; left: 6px; right: 6px; height: 3px; border-radius: 3px; background: var(--cta-500); }
.ge-item.drop-before::before { top: -3px; } .ge-item.drop-after::after { bottom: -3px; }
.ge-add { margin: 10px 12px 14px; height: 40px; border-radius: 10px; font-size: 13.5px; }
.ge-menu { position: fixed; z-index: 90; background: #fff; border: 1px solid var(--border-soft); border-radius: 12px; box-shadow: 0 12px 32px rgba(20,40,90,.18); padding: 6px; min-width: 190px; }
.ge-menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; border: 0; background: none; border-radius: 8px; padding: 0 10px; font: inherit; font-size: 13.5px; color: var(--text-strong); cursor: pointer; text-align: left; }
.ge-menu button:hover:not(:disabled) { background: #f0f5fe; }
.ge-menu button:disabled { opacity: .4; cursor: default; }
.ge-menu button.danger { color: #d22c4a; }
.ge-menu hr { border: 0; border-top: 1px solid var(--border-soft); margin: 4px 2px; }

/* ---------- Cột giữa ---------- */
.ge-center { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding-right: 2px; }
.ge-stage { flex-shrink: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; position: relative; background: #cfe6c8; box-shadow: var(--shadow-sm); max-height: calc(58vh * var(--vz, 1)); width: 100%; }
.ge-stage .bt-host { position: absolute; inset: 0; }
.ge-stage .badge { position: absolute; left: 12px; bottom: 10px; z-index: 3; background: rgba(20,48,92,.72); color: #fff; font-size: 11.5px; padding: 3px 10px; border-radius: 99px; pointer-events: none; }
.ge-editor { flex-shrink: 0; padding: 0 0 12px; }
.ge-tabs { display: flex; gap: 6px; padding: 8px 12px 0; border-bottom: 1px solid var(--border-soft); }
.ge-tabs button { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.ge-tabs button.on { color: var(--cta-500); border-bottom-color: var(--cta-500); }
.ge-tabs .icon { width: 20px; height: 20px; }
.ge-tab { padding: 12px 18px 4px; }
.ge-tab[hidden] { display: none; }
.ge-lab { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--text-strong); margin: 4px 0 6px; }
.ge-lab .req { color: #e0475f; }
.ge-lab .sym { margin-left: auto; display: flex; gap: 3px; flex-wrap: wrap; }
.ge-lab .sym button { min-width: 28px; height: 26px; border: 1px solid var(--border); background: #fff; border-radius: 6px; font: inherit; font-size: 13px; color: var(--text-strong); cursor: pointer; padding: 0 5px; }
.ge-lab .sym button:hover { border-color: var(--cta-500); color: var(--cta-500); }
.ge-ta { width: 100%; border: 1.4px solid var(--border); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 15px; color: var(--text-strong); resize: none; outline: 0; line-height: 1.4; background: #fff; overflow: hidden; min-height: 42px; display: block; }
.ge-ta:focus { border-color: var(--cta-500); box-shadow: 0 0 0 3px rgba(43,123,254,.12); }
.ge-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.ge-opt { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 12px; }
.ge-opt.ok { background: #e6f7ec; }
.ge-opt .rd { width: 20px; height: 20px; border-radius: 50%; border: 1.6px solid #a7afc6; background: #fff; flex-shrink: 0; cursor: pointer; padding: 0; display: grid; place-items: center; }
.ge-opt.ok .rd { border-color: #1fae55; }
.ge-opt.ok .rd::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #1fae55; }
.ge-opt .lt { font-weight: 700; font-size: 14px; color: var(--text-strong); width: 18px; }
.ge-opt .wrap { position: relative; flex: 1; min-width: 0; }
.ge-opt .ge-ta { padding-right: 36px; font-size: 14.5px; min-height: 38px; padding-top: 7px; padding-bottom: 7px; }
.ge-opt.ok .ge-ta { border-color: #7fd39d; background: #f3fcf6; }
.ge-opt .ck { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; display: none; fill: #1fae55; stroke: #fff; }
.ge-opt.ok .ck { display: block; }
.ge-hint { font-size: 12.5px; color: var(--text-muted); margin: 6px 0 0; }
.ge-msgs { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.ge-msgs div { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 6px 10px; border-radius: 8px; }
.ge-msgs .e { background: #ffeef0; color: #c22543; } .ge-msgs .w { background: #fff6e3; color: #9a5a00; }
.ge-msgs .icon { width: 16px; height: 16px; flex-shrink: 0; }
.ge-extra { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 8px; }
.ge-extra summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--cta-500); list-style: none; display: flex; align-items: center; gap: 6px; }
.ge-extra summary::-webkit-details-marker { display: none; }
.ge-extra .row2 { display: grid; grid-template-columns: 200px 1fr; gap: 14px; margin-top: 8px; }
.ge-num { width: 100%; height: 38px; border: 1.4px solid var(--border); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 14px; outline: 0; }
.ge-num:focus { border-color: var(--cta-500); }

/* Thiết lập nâng cao (tab) */
.ge-adv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 26px; }
.ge-row { display: flex; align-items: center; gap: 12px; min-height: 46px; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; color: var(--text-strong); }
.ge-row > span { flex: 1; } .ge-row small { display: block; font-size: 11.5px; color: var(--text-muted); }
.ge-sel { height: 36px; border: 1.4px solid var(--border); border-radius: 9px; padding: 0 30px 0 10px; font: inherit; font-size: 13px; color: var(--text-strong); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23142a52' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 16px; appearance: none; outline: 0; cursor: pointer; max-width: 230px; }
.ge-sel:focus { border-color: var(--cta-500); }
.ge-seg2 { display: inline-flex; background: var(--bg-soft); border-radius: 9px; padding: 3px; gap: 3px; }
.ge-seg2 button { border: 0; background: none; height: 30px; padding: 0 12px; border-radius: 7px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.ge-seg2 button.on { background: #fff; color: var(--cta-500); box-shadow: 0 1px 4px rgba(20,40,90,.12); }

/* ---------- Cột phải: thiết lập ---------- */
.ge-set { overflow-y: auto; }
.ge-set .body { padding: 2px 16px 16px; }
.ge-set .grp { padding: 10px 0; border-top: 1px solid var(--border-soft); }
.ge-set .grp:first-child { border-top: 0; padding-top: 2px; }
.ge-set label.t { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--text-strong); margin-bottom: 8px; }
.ge-set label.t .icon { width: 20px; height: 20px; color: var(--text-strong); }
.ge-input { width: 100%; height: 40px; border: 1.4px solid var(--border); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--text-strong); outline: 0; }
.ge-input:focus { border-color: var(--cta-500); }
.ge-step { display: flex; align-items: center; height: 42px; border: 1.4px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.ge-step button { width: 46px; height: 100%; border: 0; background: none; font-size: 22px; color: var(--text-strong); cursor: pointer; flex-shrink: 0; }
.ge-step button:hover { background: #f1f5fd; color: var(--cta-500); }
.ge-step input { flex: 1; min-width: 0; border: 0; outline: 0; text-align: right; font: inherit; font-size: 15px; font-weight: 600; color: var(--text-strong); padding: 0 4px; }
.ge-step em { font-style: normal; font-size: 15px; font-weight: 600; color: var(--text-strong); flex: 1; padding-left: 4px; }
.ge-step.off { opacity: .45; pointer-events: none; }
.ge-sw { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; }
.ge-sw .icon { width: 22px; height: 22px; color: var(--text-strong); margin-top: 1px; flex-shrink: 0; }
.ge-sw div { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--text-strong); }
.ge-sw small { display: block; font-size: 11.5px; font-weight: 400; color: var(--text-muted); margin-top: 1px; }
.tgl { position: relative; width: 44px; height: 24px; flex-shrink: 0; appearance: none; background: #cdd5e3; border-radius: 99px; cursor: pointer; transition: background .2s; margin: 0; }
.tgl::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.tgl:checked { background: var(--cta-500); }
.tgl:checked::after { transform: translateX(20px); }
.ge-set .ge-sel { width: 100%; max-width: none; height: 40px; font-size: 13.5px; }

/* ---------- Thông báo nhỏ có nút Hoàn tác ---------- */
.ge-snack { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 95; background: #1f2d4a; color: #fff; border-radius: 12px; padding: 10px 12px 10px 18px; display: flex; align-items: center; gap: 14px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.ge-snack button { border: 0; background: rgba(255,255,255,.14); color: #fff; border-radius: 8px; height: 30px; padding: 0 12px; font: inherit; font-weight: 600; cursor: pointer; }

/* ---------- Hộp thoại ---------- */
.ge-dialog-back, .qi-back { position: fixed; inset: 0; z-index: 100; background: rgba(28,42,74,.42); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; }
.ge-dialog { background: #fff; border-radius: 16px; padding: 20px 22px 16px; width: min(420px, 100%); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.ge-dialog h3 { margin: 0 0 8px; font-size: 17px; color: var(--text-strong); }
.ge-dialog p { margin: 0 0 16px; font-size: 14px; color: var(--text); line-height: 1.5; }
.ge-dialog-act { display: flex; justify-content: flex-end; gap: 10px; }
.btn-danger { background: #e0475f; color: #fff; border: 0; }

/* ---------- Cửa sổ Nhập câu hỏi nhanh ---------- */
.qi { background: #fff; border-radius: 18px; width: min(1000px, 100%); max-height: calc(100vh * var(--vz, 1) - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.qi-head { display: flex; align-items: flex-start; gap: 14px; padding: 18px 22px 12px; }
.qi-head .ic { width: 40px; height: 40px; color: var(--brand-600); flex-shrink: 0; }
.qi-head h2 { margin: 0; font-size: 21px; font-weight: 800; color: var(--text-strong); letter-spacing: -.3px; }
.qi-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--text); }
.qi-head .x { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-soft); background: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-xs); }
.qi-head .x .icon { width: 18px; height: 18px; }
.qi-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 18px; flex: 1; min-height: 0; }
.qi-col { border: 1px solid var(--border-soft); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; min-height: 0; background: #fbfcff; }
.qi-col h3 { display: flex; align-items: center; margin: 0 0 10px; font-size: 16px; font-weight: 700; color: var(--text-strong); }
.qi-col h3 a { margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--cta-500); text-decoration: underline; cursor: pointer; }
.qi-text { flex: 1; min-height: 300px; width: 100%; border: 1.4px solid var(--border); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.5; color: var(--text-strong); resize: none; outline: 0; background: #fff; }
.qi-text:focus { border-color: var(--cta-500); }
.qi-sum { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.qi-sum span { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; }
.qi-sum .icon { width: 16px; height: 16px; }
.qi-sum .a { background: #e8f0fe; color: var(--text-strong); } .qi-sum .b { background: #e3f6ea; color: #13853f; } .qi-sum .c { background: #fff1db; color: #a35f00; }
.qi-sum .b .icon { fill: #1fae55; stroke: #fff; }
.qi-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 2px; min-height: 120px; }
.qi-empty { margin: auto; text-align: center; font-size: 13.5px; color: var(--text-muted); max-width: 300px; line-height: 1.5; }
.qi-card { border: 1px solid var(--border-soft); border-radius: 12px; padding: 10px 12px; background: #fff; }
.qi-card.bad { border-color: #f2b3be; background: #fffafb; }
.qi-card.warn { border-color: #f4d79c; }
.qi-card .top { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; font-weight: 700; color: var(--text-strong); margin-bottom: 8px; white-space: pre-line; }
.qi-card .top span { flex: 1; }
.qi-card .top .ed { width: 30px; height: 28px; border: 1px solid var(--border-soft); border-radius: 7px; background: #fff; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.qi-card .top .ed .icon { width: 16px; height: 16px; color: var(--cta-500); }
.qi-card .ops { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.qi-card .op { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-strong); padding: 5px 8px; border-radius: 8px; cursor: pointer; white-space: pre-line; }
.qi-card .op:hover { background: #f3f6fc; }
.qi-card .op i { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #a7afc6; flex-shrink: 0; display: grid; place-items: center; }
.qi-card .op.ok { background: #e3f6ea; border: 1px solid #b6e6c6; }
.qi-card .op.ok i { border-color: #1fae55; } .qi-card .op.ok i::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #1fae55; }
.qi-card .op.empty { color: var(--text-muted); font-style: italic; }
.qi-card .msg { margin-top: 8px; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.qi-card .msg .e { color: #c22543; } .qi-card .msg .w { color: #9a5a00; }
.qi-card .edit textarea, .qi-card .edit input { width: 100%; border: 1.3px solid var(--border); border-radius: 8px; padding: 6px 9px; font: inherit; font-size: 13.5px; outline: 0; }
.qi-card .edit textarea { resize: vertical; min-height: 54px; margin-bottom: 6px; }
.qi-card .edit .o { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 13px; font-weight: 700; }
.qi-card .edit .o input[type=radio] { width: 16px; height: 16px; flex-shrink: 0; }
.qi-card .edit .act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.qi-card .edit .act button { height: 30px; font-size: 12.5px; padding: 0 12px; }
.qi-stray { font-size: 12px; color: #9a5a00; background: #fff6e3; border-radius: 8px; padding: 7px 10px; }
.qi-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px 16px; margin-top: 12px; border-top: 1px solid var(--border-soft); }
.qi-mode { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--text-strong); margin-right: auto; }
.qi-mode label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.qi-mode input { width: 18px; height: 18px; accent-color: #1fae55; margin: 0; }
.qi-foot .btn-md { height: 40px; font-size: 13.5px; padding: 0 16px; }
.qi-foot .btn-md .icon { width: 18px; height: 18px; }
.qi-foot .btn-cta:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.qi-ai-note { font-size: 12px; color: var(--text-muted); padding: 0 22px; margin-top: 8px; }
.qi-ai-note.show { color: #9a5a00; }
.qi-help { position: absolute; inset: 0; background: rgba(255,255,255,.97); border-radius: 18px; padding: 20px 24px; overflow: auto; z-index: 2; font-size: 13.5px; color: var(--text-strong); line-height: 1.55; }
.qi-help pre { background: #f4f7fc; border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 13px; white-space: pre-wrap; margin: 6px 0 12px; }
.qi-help h3 { margin: 0 0 8px; } .qi-help .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* =========================================================
   Khung trò chơi Bắn trứng (đơn vị 960×540, co giãn đều)
   ========================================================= */
.bt-host { position: relative; overflow: hidden; background: #2b4a6e; font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; }
.bt-backdrop { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(22px) saturate(1.1) brightness(.92); }
.bt-layer { position: absolute; left: 0; top: 0; width: 960px; height: 540px; transform-origin: 0 0; }
.bt-layer canvas { position: absolute; inset: 0; width: 960px; height: 540px; display: block; cursor: crosshair; touch-action: none; }
.bt-logo { position: absolute; left: 10px; top: 6px; width: 150px; height: auto; pointer-events: none; user-select: none; filter: drop-shadow(0 3px 4px rgba(0,0,0,.18)); }
.bt-chips { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; pointer-events: none; white-space: nowrap; }
.bt-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 17px; background: url("../games/thap-sang-khu-vuon/frame-info.webp") center / 100% 100% no-repeat; filter: drop-shadow(0 3px 4px rgba(20,48,92,.22)); font-size: 14px; color: #4a2a0c; }
.bt-chip > img { height: 20px; width: auto; display: block; }
.bt-hearts { gap: 3px; } .bt-hearts img { height: 22px; width: auto; display: block; } .bt-hearts img.off { filter: grayscale(1) brightness(1.15); opacity: .4; }
.bt-chip i { font-style: normal; font-size: 16px; } .bt-chip b { font-weight: 800; }
.bt-chip.warn { color: #c22543; animation: btPulse .5s ease-in-out infinite alternate; }
@keyframes btPulse { to { transform: scale(1.06); } }
.bt-chip[hidden] { display: none; }
.bt-team b { font-weight: 600; padding: 2px 8px; border-radius: 99px; font-size: 13px; }
.bt-team b.on { background: var(--cta-500, #2b7bfe); color: #fff; }
.bt-qn { position: absolute; right: 12px; top: 8px; height: 36px; padding: 0 18px; background: url("../games/thap-sang-khu-vuon/frame-info.webp") center / 100% 100% no-repeat; color: #4a2a0c; font-size: 15px; font-weight: 800;
  display: flex; align-items: center; filter: drop-shadow(0 3px 4px rgba(20,48,92,.22)); white-space: nowrap; pointer-events: none; }
.bt-qn:empty { display: none; }
/* Khung gỗ v2 (board.png 1300×340): vùng chữ nằm trong phần gỗ sáng */
.bt-board { position: absolute; left: 50%; top: 40px; transform: translateX(-50%); width: 584px; height: 153px; background: center / 100% 100% no-repeat;
  padding: 37px 40px 20px; box-sizing: border-box; pointer-events: none; }
.bt-qt { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 800; color: #4a2a0c; line-height: 1.18;
  white-space: pre-line; overflow: hidden; letter-spacing: -.3px; word-break: break-word; overflow-wrap: anywhere; }
.bt-qt.ph { color: #4a2a0c66; font-weight: 600; }
.bt-fb { position: absolute; left: 50%; top: 158px; z-index: 3; transform: translateX(-50%) scale(.8); opacity: 0; padding: 8px 22px; border-radius: 99px; font-weight: 800; font-size: 20px; color: #fff; transition: .25s; pointer-events: none; white-space: nowrap; max-width: 90%; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.bt-fb.on { opacity: 1; transform: translateX(-50%) scale(1); }
.bt-fb.ok { background: #14935a; } .bt-fb.no { background: #d62f55; }
.bt-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); background: rgba(255,255,255,.95); color: #14305c; font-weight: 700; padding: 10px 20px; border-radius: 99px; font-size: 15px; }
.bt-tags span { position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: #14305c; color: #fff; font-size: 15px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.25); border: 2px solid #fff; box-sizing: border-box; pointer-events: none; transition: opacity .2s; }
.bt-tags .c-pink { background: #e8517f; } .bt-tags .c-yellow { background: #e09a00; } .bt-tags .c-green { background: #2f9e5b; } .bt-tags .c-purple { background: #8c55cc; }

/* =========================================================
   Trình chơi: Xem trước (cửa sổ) và Trình chiếu (toàn màn hình)
   ========================================================= */
body.gp-open { overflow: hidden; }
.gp-root { position: fixed; z-index: 120; display: flex; flex-direction: column; font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; }
.gp-preview { inset: 0; background: rgba(20,32,60,.6); backdrop-filter: blur(4px); padding: 22px; align-items: center; justify-content: center; }
.gp-preview > * { width: min(100%, calc((100vh - 150px) * 16 / 9)); }
.gp-head { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px 14px 0 0; padding: 10px 12px 10px 18px; }
.gp-head b { font-size: 16px; color: var(--text-strong); } .gp-head span { font-size: 12.5px; color: #a35f00; background: #fff3dc; padding: 3px 10px; border-radius: 99px; }
.gp-x { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border-soft); background: #fff; cursor: pointer; font-size: 15px; }
.gp-stage { position: relative; aspect-ratio: 16 / 9; background: #2b4a6e; }
.gp-host { position: absolute; inset: 0; }
.gp-preview .gp-ctrl { border-radius: 0 0 14px 14px; }
.gp-ctrl { display: flex; align-items: center; justify-content: center; gap: 8px; background: #fff; padding: 8px 12px; }
.gp-ctrl button { min-width: 42px; height: 36px; border: 1px solid var(--border); background: #fff; border-radius: 10px; font-size: 15px; cursor: pointer; color: var(--text-strong); padding: 0 10px; }
.gp-ctrl button:hover { border-color: var(--cta-500); }
.gp-count { font-size: 13.5px; font-weight: 700; color: var(--text-strong); min-width: 90px; text-align: center; }
.gp-present { inset: 0; background: #1d3554; }
.gp-present .gp-stage { flex: 1; aspect-ratio: auto; }
.gp-present .gp-ctrl { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); background: rgba(255,255,255,.95); transition: opacity .3s; z-index: 5; }
.gp-present.gp-idle .gp-ctrl { opacity: 0; pointer-events: none; }
.gp-present.gp-idle { cursor: none; }
.gp-present .gp-exit { color: #c22543; }
.gp-pause { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(15,30,60,.45); }
.gp-pause[hidden], .gp-sum[hidden], .gp-next[hidden], .gp-note[hidden] { display: none; }
.gp-pause div { background: #fff; border-radius: 18px; padding: 18px 28px; text-align: center; }
.gp-pause b { display: block; font-size: 26px; color: var(--text-strong); } .gp-pause span { font-size: 13.5px; color: var(--text); }
.gp-next { position: absolute; right: 2.5%; bottom: 4%; z-index: 4; height: 46px; padding: 0 22px; border: 0; border-radius: 14px; background: var(--grad-cta, #2b7bfe); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 18px rgba(36,116,253,.4); }
.gp-note { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 6; background: rgba(20,32,60,.88); color: #fff; font-size: 13px; padding: 8px 16px; border-radius: 10px; max-width: 90%; text-align: center; }
.gp-sum { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(255,246,207,.88); padding: 3%; }
.gp-card { background: #fff; border-radius: 22px; padding: 22px 28px; text-align: center; box-shadow: 0 16px 40px rgba(60,40,0,.2); width: min(560px, 100%); max-height: 100%; overflow: auto; }
.gp-stars { font-size: 38px; }
.gp-card h2 { margin: 2px 0 12px; font-size: 30px; color: #0b6b5d; }
.gp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.gp-grid div { background: #f3f6fc; border-radius: 12px; padding: 10px 4px; }
.gp-grid b { display: block; font-size: 26px; color: var(--text-strong); } .gp-grid span { font-size: 12px; color: var(--text); }
.gp-grid .ok { background: #e3f6ea; } .gp-grid .ok b { color: #13853f; } .gp-grid .no { background: #ffeef0; } .gp-grid .no b { color: #c22543; }
.gp-total { font-size: 18px; color: var(--text-strong); margin-bottom: 16px; } .gp-total b { font-size: 24px; color: var(--cta-500); }
.gp-act { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.gp-ans { text-align: left; width: min(720px, 100%); }
.gp-ans h2 { text-align: center; }
.gp-ans ol { margin: 0 0 14px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.gp-ans li { position: relative; padding-right: 96px; font-size: 14px; }
.gp-ans .t { font-weight: 700; color: var(--text-strong); white-space: pre-line; } .gp-ans .a { color: var(--text); } .gp-ans em { display: block; font-size: 12.5px; color: var(--text-muted); }
.gp-ans .r { position: absolute; right: 0; top: 0; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: #eef2f8; color: var(--text); }
.gp-ans .r.ok { background: #e3f6ea; color: #13853f; } .gp-ans .r.no { background: #ffeef0; color: #c22543; }

/* ---------- Màn hình nhỏ ---------- */
@media (max-width: 1200px) {
  .ge-main { grid-template-columns: 210px minmax(0, 1fr) 260px; gap: 12px; }
  .ge-page .topbar { gap: 10px; }
  .ge-doc input { width: 130px; }
  .ge-adv { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .ge-page .topbar .btn-md .lbl-long { display: none; }
  .ge-saved { font-size: 0; gap: 0; padding: 0 8px; }
  .ge-opts { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  body.ge-page { overflow: auto; }
  .ge-page .main { height: auto; }
  .ge-main { grid-template-columns: 200px minmax(0, 1fr); }
  .ge-set { grid-column: 1 / -1; }
  .ge-items { max-height: 50vh; }
  .ge-center { overflow: visible; }
  .ge-doc { display: none; }
}
@media (max-width: 760px) {
  .ge-main { grid-template-columns: 1fr; }
  .ge-items { max-height: 260px; }
  .ge-page .topbar .btn-md { font-size: 0; gap: 0; padding: 0 10px; }
  .ge-page .topbar .btn-md .icon { width: 20px; height: 20px; }
  .qi-body { grid-template-columns: 1fr; overflow-y: auto; }
  .qi-text { min-height: 200px; }
  .qi-foot { flex-wrap: wrap; }
  .qi-mode { width: 100%; }
  .ge-extra .row2 { grid-template-columns: 1fr; }
  .gp-preview { padding: 8px; }
}

/* ---------- Trang Tạo trò chơi: thẻ mẫu mới + Trò chơi của tôi ---------- */
.game { position: relative; }
.game-new { position: absolute; top: 10px; left: 10px; z-index: 1; background: #ff7a1a; color: #fff; font-size: 11.5px; font-weight: 800;
  padding: 3px 9px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
a.btn-md { display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.mine-n:not(:empty) { margin-left: 6px; background: var(--cta-500); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 9px; display: inline-grid; place-items: center; padding: 0 5px; }
.game-bar .on .mine-n:not(:empty) { background: #fff; color: var(--cta-500); }
.my-games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.my-game { background: #fff; border: 1px solid var(--border-soft); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.mg-thumb { position: relative; }
.mg-thumb img { width: 100%; height: 150px; object-fit: cover; display: block; }
.mg-chip { position: absolute; top: 10px; left: 10px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.mg-chip.done { background: #e3f7ea; color: #178a46; }
.mg-chip.draft { background: #fff3dc; color: #b26a00; }
.mg-body { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.mg-body h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-body p { margin: 0; font-size: 13px; color: var(--text); }
.mg-body p em { color: #c2410c; font-style: normal; }
.mg-body .mg-meta { font-size: 12px; color: var(--text-muted, #7a8599); }
.mg-foot { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.mg-foot .btn-md { height: 34px; font-size: 13.5px; padding: 0 14px; }
.mg-btn { background: #eef3fd; color: var(--cta-500); border: 0; border-radius: 10px; font-weight: 600; cursor: pointer; }
.mg-btn:hover { background: #dfe8fb; }
.mg-del { margin-left: auto; background: #fdeeee; color: #c62828; }
.mg-del:hover { background: #fbdcdc; }
.my-empty { grid-column: 1/-1; background: #fff; border: 1px dashed var(--border-soft); border-radius: 16px; padding: 36px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px; }
.my-empty b { font-size: 16px; color: var(--text-strong); }
.my-empty span { font-size: 13.5px; color: var(--text); }
@media (max-width: 1100px) { .my-games { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .my-games { grid-template-columns: 1fr; } }

/* ===================== Nuôi khủng long (engine-nuoi-khung-long.js) ===================== */
.ge-stage .nk-host, .gp-host.nk-host { position: absolute; inset: 0; }
.nk-host { overflow: hidden; background: #3d7a2c; font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; }
.nk-backdrop { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(22px) saturate(1.1) brightness(.92); }
.nk-layer { position: absolute; left: 0; top: 0; width: 960px; height: 540px; transform-origin: 0 0; overflow: hidden; }
.nk-bg { position: absolute; inset: 0; background-size: cover; background-position: center 30%; }
.nk-layer canvas { position: absolute; inset: 0; width: 960px; height: 540px; display: block; pointer-events: none; z-index: 2; }
.nk-logo { position: absolute; left: 12px; top: 6px; width: 158px; z-index: 3; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
.nk-hud { position: absolute; right: 12px; top: 12px; z-index: 3; display: flex; gap: 7px; padding: 8px 12px; background-size: 100% 100%; border-radius: 18px; }
.nk-hud span { background: linear-gradient(#fff6dc, #f1dcaa); color: #4a2a0c; font-weight: 800; font-size: 15px; padding: 5px 13px; border-radius: 99px; white-space: nowrap; box-shadow: inset 0 -2px 0 rgba(140,90,30,.25); }
.nk-hud span[hidden] { display: none; }
.nk-hud .nk-time.warn { background: linear-gradient(#ffd9d9, #ffb4b4); color: #a3122f; animation: btPulse .5s infinite alternate; }
.nk-hud .nk-score.pop { animation: nkPop .6s; }
@keyframes nkPop { 0% { transform: scale(1); } 35% { transform: scale(1.3); background: #fff3a6; } 100% { transform: scale(1); } }
.nk-q { position: absolute; left: 196px; top: 66px; width: 568px; height: 124px; z-index: 3; background-size: 100% 100%; padding: 20px 62px 24px; box-sizing: border-box; display: flex; }
.nk-qt { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; color: #3d2209; font-weight: 800; line-height: 1.18; overflow: hidden; white-space: pre-wrap; word-break: break-word; }
.nk-qt.ph { color: #9a7b55; font-weight: 600; }
.nk-baskets { position: absolute; inset: 0; z-index: 1; }
.nk-basket { position: absolute; padding: 0; border: 0; background: none; cursor: default; transition: transform .25s, filter .25s, opacity .25s; border-radius: 22px; font-family: inherit; }
.nk-basket img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; filter: drop-shadow(0 6px 6px rgba(40,60,10,.28)); }
.nk-plate { position: absolute; left: 11%; right: 11%; top: 62%; height: 29%; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2px 6px; box-sizing: border-box;
  background: linear-gradient(#fffaf0, #f6e7c6); border: 2px solid #b98a4d; border-radius: 9px; color: #3d2209; font-weight: 800; line-height: 1.1; overflow: hidden; word-break: break-word; box-shadow: inset 0 -2px 0 rgba(150,100,40,.18); }
.nk-plate b { color: #8a4a12; }
.nk-basket.ph .nk-plate { color: #a88a64; }
.nk-play .nk-basket { cursor: pointer; }
.nk-play .nk-basket:hover { transform: translateY(-5px) scale(1.04); filter: brightness(1.06); }
.nk-basket.nk-pick { transform: scale(.97); }
.nk-basket.ok { animation: nkBounce .5s; filter: drop-shadow(0 0 10px #ffe066) drop-shadow(0 0 18px #ffd23f); }
.nk-basket.show { filter: drop-shadow(0 0 8px #3fd17f) drop-shadow(0 0 14px #2fbf6a); }
.nk-basket.no { animation: nkShake .45s; filter: saturate(.6) drop-shadow(0 0 6px rgba(240,120,120,.8)); }
.nk-basket.dim { opacity: .6; }
.nk-basket.ok .nk-plate, .nk-basket.show .nk-plate { border-color: #23a35a; background: linear-gradient(#f2fff4, #d4f5dd); }
.nk-basket.no .nk-plate { border-color: #e48a8a; background: linear-gradient(#fff6f4, #fbe0dc); }
@keyframes nkBounce { 0% { transform: scale(1); } 40% { transform: scale(1.1) translateY(-6px); } 100% { transform: scale(1); } }
@keyframes nkShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.nk-fb { position: absolute; left: 50%; top: 196px; z-index: 4; transform: translateX(-50%) scale(.8); opacity: 0; padding: 7px 22px; border-radius: 99px; font-weight: 800; font-size: 19px; color: #fff; transition: .25s; pointer-events: none; white-space: nowrap; max-width: 80%; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.nk-fb.on { opacity: 1; transform: translateX(-50%) scale(1); }
.nk-fb.ok { background: #14935a; } .nk-fb.no { background: #d9822b; }
.nk-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); background: rgba(255,255,255,.95); color: #2c4a12; font-weight: 700; padding: 10px 20px; border-radius: 99px; font-size: 15px; z-index: 6; }
/* tổng kết */
.nk-sum { position: absolute; inset: 0; z-index: 8; animation: nkFade .5s; }
@keyframes nkFade { from { opacity: 0; } to { opacity: 1; } }
.nk-sbg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.nk-conf { position: absolute; inset: 0; width: 960px; height: 540px; pointer-events: none; z-index: 3; }
.nk-sm { position: absolute; left: 10px; bottom: 26px; height: 250px; z-index: 1; filter: drop-shadow(0 6px 6px rgba(0,0,0,.2)); }
.nk-sb { position: absolute; right: 22px; bottom: 26px; z-index: 1; transform: scaleX(-1); filter: drop-shadow(0 6px 6px rgba(0,0,0,.2)); }
.nk-snest { position: absolute; right: 24px; bottom: 24px; width: 170px; height: 150px; z-index: 1; }
.nk-snest img { position: absolute; left: 0; bottom: 0; width: 170px; }
.nk-snest .nk-segg { width: auto; height: 78px; left: 50%; bottom: 30px; transform: translateX(-50%); }
.nk-sf { position: absolute; left: 230px; top: 30px; width: 500px; height: 368px; background-size: 100% 100%; z-index: 2; }
/* tiêu đề nằm giữa mặt bảng gỗ trên khung (đo trên frame-summary: x 25,5–72,3%, y 5–21%) */
.nk-st { position: absolute; left: 30%; width: 39%; top: 6%; height: 14%; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff8e1; font-weight: 900; font-size: 17px; line-height: 1.1; white-space: nowrap;
  -webkit-text-stroke: 4px #5a2c06; paint-order: stroke fill; text-shadow: 0 3px 0 #3d1c02, 0 4px 6px rgba(40,18,0,.55); }
/* nội dung nằm gọn trong lòng khung kem (y 25,6–92,2%) */
.nk-sc { position: absolute; left: 10%; right: 10%; top: 29%; bottom: 11.5%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; }
.nk-sg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: 100%; }
.nk-sg div { background: #fff; border: 2px solid #ecd9b0; border-radius: 10px; padding: 4px 2px; text-align: center; box-shadow: 0 2px 0 rgba(160,110,40,.15); }
.nk-sg b { display: block; font-size: 21px; line-height: 1.15; color: #3d2209; }
.nk-sg span { display: block; font-size: 10.5px; color: #7a5a35; font-weight: 600; white-space: nowrap; }
.nk-sg .ok b { color: #14935a; } .nk-sg .no b { color: #d14a3c; } .nk-sg .pt b { color: #c27a00; }
.nk-strophy { height: 58px; filter: drop-shadow(0 4px 4px rgba(120,70,0,.25)); }
.nk-smsg { margin: 0; font-weight: 800; font-size: 16px; color: #4a2a0c; text-align: center; line-height: 1.25; }
.nk-smsg.full { color: #0f7c48; font-size: 17px; }
.nk-sa { display: flex; gap: 10px; }
.nk-btn { font: 800 14px "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; padding: 7px 16px; border-radius: 99px; border: 2px solid #c79654; background: #fff8e8; color: #5a3410; cursor: pointer; }
.nk-btn.cta { background: linear-gradient(#ffb43c, #f08a1c); border-color: #c86a0e; color: #fff; }
.nk-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .nk-basket, .nk-basket.ok, .nk-basket.no, .nk-score.pop, .nk-sum { animation: none !important; transition: none !important; } }
.ge-row[hidden] { display: none; }

/* ===================== Thắp sáng khu vườn (engine-thap-sang-khu-vuon.js) ===================== */
.ge-stage .ts-host, .gp-host.ts-host { position: absolute; inset: 0; }
.ts-host { overflow: hidden; background: #141c4a; font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; }
.ts-backdrop { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(22px) brightness(.55) saturate(1.1); }
.ts-layer { position: absolute; left: 0; top: 0; width: 960px; height: 540px; transform-origin: 0 0; overflow: hidden; }
/* nền được phóng to và dịch trái để lối đi nằm trong khu vườn bên trái, bãi cỏ bên phải dành cho chậu đáp án */
.ts-bg { position: absolute; left: -215px; top: -60px; width: 1200px; height: 675px; background-size: 100% 100%; }
.ts-cv { position: absolute; inset: 0; width: 960px; height: 540px; display: block; pointer-events: none; z-index: 1; }
.ts-logo { position: absolute; left: 10px; top: 4px; width: 150px; z-index: 3; pointer-events: none; filter: drop-shadow(0 3px 5px rgba(0,0,0,.35)); }
.ts-hud { position: absolute; right: 10px; top: 10px; z-index: 3; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; align-items: center; width: 322px; }
.ts-hud .ts-ib { order: 5; }
.ts-inplayer .ts-hud::after { content: ""; order: 4; flex-basis: 100%; height: 0; }
.ts-pill { display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px; background-size: 100% 100%; color: #4a2a0c; font-weight: 800; font-size: 13.5px; white-space: nowrap; }
.ts-pill img { height: 20px; }
.ts-pill[hidden] { display: none; }
.ts-time.warn b { color: #c0182f; animation: btPulse .5s infinite alternate; }
.ts-score.pop { animation: tsPop .6s; }
@keyframes tsPop { 0% { transform: scale(1); } 35% { transform: scale(1.25); } 100% { transform: scale(1); } }
.ts-ib { display: none; width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; transition: transform .15s; }
.ts-ib img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.ts-ib:hover { transform: scale(1.1); }
.ts-inplayer .ts-ib { display: block; }
.ts-muted .ts-mute { opacity: .45; filter: grayscale(.8); }
/* khung câu hỏi co giãn bằng border-image: góc hoa giữ nguyên, không méo */
.ts-q { position: absolute; left: 170px; top: 6px; width: 462px; height: 118px; z-index: 3; box-sizing: border-box; display: flex;
  border-style: solid; border-width: 30px 52px 26px; border-image-slice: 23% 13% 17% fill; border-image-repeat: stretch; padding: 2px 0 0; }
.ts-qt { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; color: #3d2209; font-weight: 800; line-height: 1.18; overflow: hidden; white-space: pre-wrap; word-break: break-word; }
.ts-qt.ph { color: #9a7b55; font-weight: 600; }
.ts-pots { position: absolute; inset: 0; z-index: 2; }
.ts-pot { position: absolute; padding: 0; border: 0; background: none; cursor: default; transition: transform .25s, filter .25s, opacity .25s; font-family: inherit; transform-origin: 50% 100%; }
.ts-pot > img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; filter: drop-shadow(0 6px 6px rgba(0,0,20,.4)); }
.ts-plate { position: absolute; top: 64.5%; height: 25%; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2px 8px; box-sizing: border-box;
  color: #3d2209; font-weight: 800; line-height: 1.1; overflow: hidden; word-break: normal; overflow-wrap: normal; border-radius: 8px; }
.ts-plate > span { display: block; width: 100%; }
.ts-plate.brk > span { overflow-wrap: anywhere; }
/* chữ A B C D nằm trên vành (thanh) trên của chậu */
.ts-key { position: absolute; left: 50%; top: 58.2%; transform: translate(-50%, -50%); min-width: 30px; height: 23px; padding: 0 6px; box-sizing: border-box; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 16px; line-height: 1; color: #8a3a0c;
  background: radial-gradient(circle at 50% 35%, #fff8e4, #ffe2a6 70%, #f5c470); border: 2px solid #9b4511; box-shadow: 0 2px 3px rgba(60,20,0,.35), inset 0 -2px 0 rgba(155,69,17,.18); pointer-events: none; }
.ts-pot.ok .ts-key, .ts-pot.show .ts-key { background: radial-gradient(circle at 50% 35%, #f2fff4, #bff0cc 70%, #7fd79a); border-color: #1f8a4b; color: #156b38; }
.ts-pot.no .ts-key { background: radial-gradient(circle at 50% 35%, #fff4f2, #ffd3cc 70%, #f0a49a); border-color: #b4473c; color: #9a2f25; }
.ts-pot.ph .ts-plate { color: #a88a64; }
.ts-play .ts-pot { cursor: pointer; }
.ts-play .ts-pot:hover { transform: translateY(-5px) scale(1.04); filter: brightness(1.08); }
.ts-pot.ts-pick { transform: scale(.97); }
.ts-pot.ok { animation: tsBounce .5s; filter: drop-shadow(0 0 10px #ffe48a) drop-shadow(0 0 20px #ffd23f); }
.ts-pot.show { filter: drop-shadow(0 0 8px #7dffb0) drop-shadow(0 0 16px #2fbf6a); }
.ts-pot.no { animation: tsShake .45s; filter: saturate(.55) brightness(.9); }
.ts-pot.dim { opacity: .55; }
.ts-pot.ok .ts-plate, .ts-pot.show .ts-plate { background: rgba(200,255,210,.75); box-shadow: 0 0 0 2px #23a35a; }
.ts-pot.no .ts-plate { background: rgba(255,220,214,.8); box-shadow: 0 0 0 2px #e48a8a; }
@keyframes tsBounce { 0% { transform: scale(1); } 40% { transform: scale(1.08) translateY(-6px); } 100% { transform: scale(1); } }
@keyframes tsShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.ts-fb { position: absolute; left: 50%; top: 128px; z-index: 4; width: 270px; height: 64px; display: flex; align-items: center; justify-content: center; padding: 6px 26px 4px; box-sizing: border-box;
  transform: translateX(-50%) scale(.8); opacity: 0; background-size: 100% 100%; font-weight: 900; font-size: 18px; transition: .25s; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; filter: drop-shadow(0 4px 8px rgba(0,0,0,.3)); }
.ts-fb.on { opacity: 1; transform: translateX(-50%) scale(1); }
.ts-fb.ok { color: #12804c; } .ts-fb.no { color: #b9581a; font-size: 16px; }
.ts-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); background: rgba(255,255,255,.95); color: #2c3a72; font-weight: 700; padding: 10px 20px; border-radius: 99px; font-size: 15px; z-index: 6; }
/* tổng kết */
.ts-sum { position: absolute; inset: 0; z-index: 8; animation: tsFade .5s; }
@keyframes tsFade { from { opacity: 0; } to { opacity: 1; } }
.ts-over .ts-pots, .ts-over .ts-q, .ts-over .ts-fb { visibility: hidden; }
.ts-sbg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.ts-sdim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,12,40,.05) 0%, rgba(8,12,40,.45) 45%, rgba(8,12,40,.55) 100%); }
.ts-conf { position: absolute; inset: 0; width: 960px; height: 540px; pointer-events: none; z-index: 3; }
.ts-sff { position: absolute; left: 230px; top: 300px; height: 120px; z-index: 2; filter: drop-shadow(0 0 14px rgba(255,220,120,.7)); animation: tsHover 2.4s ease-in-out infinite; }
@keyframes tsHover { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.ts-sf { position: absolute; left: 380px; top: 46px; width: 520px; height: 407px; background-size: 100% 100%; z-index: 2; }
/* tiêu đề trên bảng gỗ (x 29,5–71%, y 3–20% của khung) */
.ts-st { position: absolute; left: 31%; width: 38%; top: 4.5%; height: 13%; display: flex; align-items: center; justify-content: center; color: #fff8e1; font-weight: 900; font-size: 22px; white-space: nowrap;
  -webkit-text-stroke: 4px #5a2c06; paint-order: stroke fill; text-shadow: 0 3px 0 #3d1c02, 0 4px 6px rgba(40,18,0,.55); }
/* nội dung trong lòng khung kem (x 13–86%, y 25–89%) */
.ts-sc { position: absolute; left: 15.5%; right: 16.5%; top: 27%; bottom: 13%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; }
.ts-sg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; width: 100%; }
.ts-sg div { background: #fff; border: 2px solid #ecd9b0; border-radius: 10px; padding: 4px 2px; text-align: center; box-shadow: 0 2px 0 rgba(160,110,40,.15); }
.ts-sg b { display: block; font-size: 20px; line-height: 1.15; color: #3d2209; }
.ts-sg span { display: block; font-size: 9.5px; color: #7a5a35; font-weight: 700; white-space: nowrap; }
.ts-sg .ok b { color: #14935a; } .ts-sg .no b { color: #d14a3c; } .ts-sg .pt b { color: #c27a00; }
.ts-strophy { height: 64px; filter: drop-shadow(0 4px 4px rgba(120,70,0,.25)); }
.ts-smsg { margin: 0; font-weight: 800; font-size: 15px; color: #4a2a0c; text-align: center; line-height: 1.25; }
.ts-smsg.full { color: #0f7c48; font-size: 16px; }
.ts-sa { display: flex; gap: 8px; }
.ts-btn { display: inline-flex; align-items: center; gap: 5px; font: 800 13.5px "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; padding: 6px 14px; border-radius: 99px; border: 2px solid #c79654; background: #fff8e8; color: #5a3410; cursor: pointer; }
.ts-btn img { height: 18px; margin-left: -6px; }
.ts-btn.cta { background: linear-gradient(#ffb43c, #f08a1c); border-color: #c86a0e; color: #fff; }
.ts-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .ts-pot, .ts-pot.ok, .ts-pot.no, .ts-score.pop, .ts-sum, .ts-sff { animation: none !important; transition: none !important; } }

/* ===================== Xây lâu đài (engine-xay-lau-dai.js) ===================== */
.ge-stage .xl-host, .gp-host.xl-host { position: absolute; inset: 0; }
.xl-host { overflow: hidden; background: #2a6fb8; font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; }
.xl-backdrop { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(22px) brightness(.6) saturate(1.1); }
.xl-layer { position: absolute; left: 0; top: 0; width: 960px; height: 540px; transform-origin: 0 0; overflow: hidden; }
/* nền chơi: bãi đất trống bên trái là nơi dựng lâu đài; bãi cỏ bên phải dành cho thẻ đáp án */
.xl-bg { position: absolute; inset: 0; background-size: 100% 100%; transition: opacity .6s; }
.xl-cv { position: absolute; inset: 0; width: 960px; height: 540px; display: block; pointer-events: none; z-index: 1; }
.xl-logo { position: absolute; left: 8px; top: 4px; width: 150px; z-index: 3; pointer-events: none; filter: drop-shadow(0 3px 5px rgba(0,0,0,.35)); }
.xl-hud { position: absolute; right: 10px; top: 10px; z-index: 3; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; align-items: center; width: 330px; }
.xl-hud .xl-ib { order: 5; }
.xl-inplayer .xl-hud::after { content: ""; order: 4; flex-basis: 100%; height: 0; }
.xl-pill { display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 14px; background-size: 100% 100%; color: #fff; font-weight: 800; font-size: 13.5px; white-space: nowrap;
  text-shadow: 0 1px 0 #1c3f86, 0 0 3px rgba(10,30,90,.6); }
.xl-pill img { height: 20px; }
.xl-pill[hidden] { display: none; }
.xl-time.warn b { color: #ffd84a; animation: btPulse .5s infinite alternate; }
.xl-score.pop { animation: xlPop .6s; }
@keyframes xlPop { 0% { transform: scale(1); } 35% { transform: scale(1.25); } 100% { transform: scale(1); } }
.xl-ib { display: none; width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; transition: transform .15s; }
.xl-ib img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.xl-ib:hover { transform: scale(1.1); }
.xl-inplayer .xl-ib { display: block; }
.xl-muted .xl-mute { opacity: .45; filter: grayscale(.8); }
/* khung câu hỏi (2176×683): lòng kem x 6,9–93,1 %, y 37–94 % */
.xl-q { position: absolute; left: 166px; top: 2px; width: 440px; height: 138px; z-index: 3; background-size: 100% 100%; filter: drop-shadow(0 4px 6px rgba(0,0,0,.25)); }
.xl-qt { position: absolute; left: 8.5%; right: 8.5%; top: 39%; bottom: 8%; display: flex; align-items: center; justify-content: center; text-align: center; color: #3d2209; font-weight: 800; line-height: 1.18; overflow: hidden; white-space: pre-wrap; word-break: break-word; }
.xl-qt.ph { color: #9a7b55; font-weight: 600; }
/* bốn thẻ tường thành (480×424): lòng kem x 7,7–92,1 %, y 37,7–86,8 %; huy hiệu giữa đỉnh y ≈ 21 % */
.xl-cards { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.xl-card { position: absolute; padding: 0; border: 0; background: none; cursor: default; transition: transform .25s, filter .25s, opacity .25s; font-family: inherit; transform-origin: 50% 100%; pointer-events: auto; }
.xl-card > img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; filter: drop-shadow(0 6px 6px rgba(0,0,20,.4)); }
.xl-plate { position: absolute; left: 10.5%; right: 10.5%; top: 40%; bottom: 15.5%; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2px 4px; box-sizing: border-box;
  color: #3d2209; font-weight: 800; line-height: 1.1; overflow: hidden; word-break: normal; overflow-wrap: normal; border-radius: 10px; }
.xl-plate > span { display: block; width: 100%; }
.xl-plate.brk > span { overflow-wrap: anywhere; }
.xl-key { position: absolute; left: 50%; top: 21.5%; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 17px; line-height: 1; color: #fff; border: 2.5px solid #ffd862;
  box-shadow: 0 2px 3px rgba(0,0,0,.35); text-shadow: 0 1px 1px rgba(0,0,0,.4); pointer-events: none; }
.xl-key.k0 { background: radial-gradient(circle at 50% 35%, #5d8ff0, #1f4fb8); }
.xl-key.k1 { background: radial-gradient(circle at 50% 35%, #f0605a, #b81f22); }
.xl-key.k2 { background: radial-gradient(circle at 50% 35%, #a874ef, #6227b0); }
.xl-key.k3 { background: radial-gradient(circle at 50% 35%, #4fc06e, #17803a); }
.xl-card.ph .xl-plate { color: #a88a64; }
.xl-play .xl-card { cursor: pointer; }
.xl-play .xl-card:hover { transform: translateY(-5px) scale(1.04); filter: brightness(1.08); }
.xl-card.xl-pick { transform: scale(.97); }
.xl-card.ok { animation: xlBounce .5s; filter: drop-shadow(0 0 10px #ffe48a) drop-shadow(0 0 20px #ffd23f); }
.xl-card.show { filter: drop-shadow(0 0 8px #7dffb0) drop-shadow(0 0 16px #2fbf6a); }
.xl-card.no { animation: xlShake .45s; filter: saturate(.55) brightness(.9); }
.xl-card.dim { opacity: .55; }
.xl-card.ok .xl-plate, .xl-card.show .xl-plate { background: rgba(200,255,210,.75); box-shadow: 0 0 0 2px #23a35a; }
.xl-card.no .xl-plate { background: rgba(255,220,214,.8); box-shadow: 0 0 0 2px #e48a8a; }
@keyframes xlBounce { 0% { transform: scale(1); } 40% { transform: scale(1.08) translateY(-6px); } 100% { transform: scale(1); } }
@keyframes xlShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.xl-fb { position: absolute; left: 774px; top: 300px; z-index: 4; width: 260px; height: 62px; display: flex; align-items: center; justify-content: center; padding: 6px 26px 4px; box-sizing: border-box;
  transform: translate(-50%, -50%) scale(.8); opacity: 0; background-size: 100% 100%; font-weight: 900; font-size: 18px; transition: .25s; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; filter: drop-shadow(0 4px 8px rgba(0,0,0,.3)); }
.xl-fb.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.xl-fb.ok { color: #12804c; } .xl-fb.no { color: #b9581a; font-size: 16px; }
.xl-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); background: rgba(255,255,255,.95); color: #2c3a72; font-weight: 700; padding: 10px 20px; border-radius: 99px; font-size: 15px; z-index: 6; }
/* tổng kết: nền lễ hội + lâu đài thật đã xây (canvas vẫn hiển thị bên trái) */
.xl-over .xl-bg { background-image: url("../games/xay-lau-dai/bg-win.jpg") !important; }
.xl-sum { position: absolute; inset: 0; z-index: 8; animation: xlFade .5s; pointer-events: none; }
.xl-sum > * { pointer-events: auto; }
@keyframes xlFade { from { opacity: 0; } to { opacity: 1; } }
.xl-over .xl-cards, .xl-over .xl-q, .xl-over .xl-fb, .xl-over .xl-pill, .xl-over .xl-pause { visibility: hidden; }
.xl-sdim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,20,60,0) 0%, rgba(8,20,60,0) 50%, rgba(8,20,60,.32) 100%); pointer-events: none !important; }
.xl-conf { position: absolute; inset: 0; width: 960px; height: 540px; pointer-events: none !important; z-index: 3; }
/* khung tổng kết 1440×1077: dải tiêu đề x 31–69 %, y 29–40 %; lòng kem x 16–84 %, y 40–91 % */
.xl-sf { position: absolute; left: 508px; top: 40px; width: 444px; height: 332px; background-size: 100% 100%; z-index: 2; filter: drop-shadow(0 6px 10px rgba(0,0,0,.3)); }
.xl-st { position: absolute; left: 31%; width: 38%; top: 29%; height: 11%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 900; font-size: 19px; white-space: nowrap;
  -webkit-text-stroke: 3px #1c3f86; paint-order: stroke fill; text-shadow: 0 2px 3px rgba(10,30,90,.5); }
.xl-sc { position: absolute; left: 18%; right: 18%; top: 42%; bottom: 11%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; }
.xl-sg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; width: 100%; }
.xl-sg div { background: #fff; border: 2px solid #ecd9b0; border-radius: 9px; padding: 3px 1px; text-align: center; box-shadow: 0 2px 0 rgba(160,110,40,.15); }
.xl-sg b { display: block; font-size: 17px; line-height: 1.15; color: #3d2209; white-space: nowrap; }
.xl-sg span { display: block; font-size: 8px; color: #7a5a35; font-weight: 700; white-space: nowrap; }
.xl-sg .ok b { color: #14935a; } .xl-sg .no b { color: #d14a3c; } .xl-sg .pt b { color: #c27a00; }
.xl-strophy { height: 40px; filter: drop-shadow(0 4px 4px rgba(120,70,0,.25)); }
.xl-smsg { margin: 0; font-weight: 800; font-size: 13px; color: #4a2a0c; text-align: center; line-height: 1.22; }
.xl-smsg.full { color: #0f7c48; font-size: 13.5px; }
.xl-sa { position: absolute; left: 508px; width: 444px; top: 382px; display: flex; gap: 8px; justify-content: center; z-index: 2; }
.xl-btn { display: inline-flex; align-items: center; gap: 5px; font: 800 14px "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; padding: 7px 16px; border-radius: 99px; border: 2px solid #3d6fc4; background: #f4f8ff; color: #1d3d7a; cursor: pointer; box-shadow: 0 3px 6px rgba(0,0,0,.25); }
.xl-btn img { height: 18px; margin-left: -6px; }
.xl-btn.cta { background: linear-gradient(#ffb43c, #f08a1c); border-color: #c86a0e; color: #fff; }
.xl-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .xl-card, .xl-card.ok, .xl-card.no, .xl-score.pop, .xl-sum { animation: none !important; transition: none !important; } }

/* ---------- Trình chơi: mẫu tự điều khiển (Mảnh ghép bí mật) ---------- */
.gp-solo .gp-ctrl, .gp-solo .gp-next, .gp-solo .gp-pause, .gp-solo .gp-sum { display: none !important; }
.gp-preview.gp-solo > * { width: min(100%, calc((100vh - 100px) * 16 / 9)); }
.gp-preview.gp-solo .gp-stage { border-radius: 0 0 14px 14px; overflow: hidden; }
.gp-solo.gp-fake { position: fixed; inset: 0; padding: 0; background: #12301f; }
.gp-solo.gp-fake > * { width: 100%; }
.gp-solo.gp-fake .gp-head { display: none; }
.gp-solo.gp-fake .gp-stage { flex: 1; aspect-ratio: auto; border-radius: 0; }
.gp-solo:fullscreen { padding: 0; background: #12301f; }
.gp-solo:fullscreen > * { width: 100%; }
.gp-solo:fullscreen .gp-head { display: none; }
.gp-solo:fullscreen .gp-stage { flex: 1; aspect-ratio: auto; border-radius: 0; }

/* =========================================================
   Mảnh ghép bí mật (tiền tố mgb-) – sân khấu 960×540, co giãn giữ tỉ lệ
   ========================================================= */
.ge-stage .mgb-host, .gp-host.mgb-host { position: absolute; inset: 0; }
.mgb-host { overflow: hidden; background: #1d4a2c; font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; user-select: none; -webkit-user-select: none;
  --mgb-blue: #2078ec; --mgb-yellow: #f2bd08; --mgb-green: #1dab19; --mgb-purple: #8e27e3; --mgb-ink: #4a2a0c; }
.mgb-backdrop { position: absolute; inset: -30px; background: url("../games/manh-ghep-bi-mat/bg-explore.jpg") center / cover; filter: blur(16px) brightness(.72); }
.mgb-layer { position: absolute; left: 0; top: 0; width: 960px; height: 540px; transform-origin: 0 0; overflow: hidden; }
.mgb-layer img { -webkit-user-drag: none; }
.mgb-layer button { font-family: inherit; }
.mgb-scr { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .35s, visibility 0s .35s; }
.mgb-scr.on { opacity: 1; visibility: visible; transition: opacity .35s; }
.mgb-bg { position: absolute; inset: 0; background: center / cover no-repeat; }
.mgb-loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15,40,22,.75); color: #fff; font-size: 20px; font-weight: 700; z-index: 30; }

/* HUD */
.mgb-logo { position: absolute; left: 6px; top: 2px; width: 150px; z-index: 3; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); }
.mgb-pill { position: absolute; top: -2px; width: 140px; z-index: 3; filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); transform-origin: 50% 40%; }
.mgb-pill img { width: 100%; display: block; }
.mgb-pill b { position: absolute; left: 42%; right: 14.5%; top: 35%; bottom: 26%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 900; color: #5a3510; white-space: nowrap; letter-spacing: -.3px; }
.mgb-pill.bump { animation: mgBump .5s; }
@keyframes mgBump { 40% { transform: scale(1.14); } }
.mgb-p-score { left: 250px; } .mgb-p-prog { left: 570px; }
.mgb-tools { position: absolute; right: 6px; top: 2px; display: flex; gap: 2px; z-index: 6; }
.mgb-tool { width: 50px; height: 46px; padding: 0; border: 0; background: none; cursor: pointer; position: relative; transition: transform .15s, filter .15s; }
.mgb-tool img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.35)); }
.mgb-tool:hover { transform: scale(1.08); filter: brightness(1.1); }
.mgb-tool i { position: absolute; left: 0; right: 0; top: 7px; text-align: center; font-style: normal; font-size: 22px; font-weight: 900; color: #fff; text-shadow: 0 2px 2px rgba(0,60,60,.6); }
.mgb-edit .mgb-tool, .mgb-edit .mgb-guess, .mgb-edit .mgb-back { pointer-events: none; }

/* Màn hình khám phá */
.mgb-pic { position: absolute; z-index: 1; }
.mgb-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.mgb-frame { position: absolute; z-index: 2; pointer-events: none; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); }
.mgb-pc { cursor: pointer; outline: none; transform-box: fill-box; transform-origin: 50% 50%; transition: transform .22s, filter .22s, opacity .55s; }
.mgb-pc:hover, .mgb-pc:focus-visible { filter: brightness(1.13) drop-shadow(0 0 16px rgba(255,248,190,.95)); }
.mgb-pc.sel { transform: translateY(-4%) scale(1.07); filter: brightness(1.2) drop-shadow(0 22px 16px rgba(0,0,0,.45)) drop-shadow(0 0 30px #ffe36a); }
.mgb-pc.glow { transform: scale(1.05); filter: brightness(1.75) saturate(.8) drop-shadow(0 0 34px #fff3a0); }
.mgb-pc.gone { opacity: 0; transform: scale(1.2); pointer-events: none; }
.mgb-pc.tried .mgb-pb { stroke: #fff; stroke-width: 6; stroke-dasharray: 22 16; }
.mgb-num { fill: #fff; stroke: rgba(50,25,0,.6); paint-order: stroke; font-weight: 900; text-anchor: middle; dominant-baseline: central; pointer-events: none; font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; }
.mgb-edit .mgb-pc { cursor: default; pointer-events: none; }
.mgb-pedestal { position: absolute; left: -2px; bottom: 2px; width: 146px; z-index: 3; filter: drop-shadow(0 4px 4px rgba(0,0,0,.35)); }
.mgb-owl { position: absolute; left: 6px; bottom: 32px; height: 165px; z-index: 4; transform-origin: 50% 100%; animation: mgBob 3.4s ease-in-out infinite; filter: drop-shadow(0 4px 4px rgba(0,0,0,.3)); }
.mgb-owl.pop { animation: mgBob 3.4s ease-in-out infinite, mgPop .5s ease-out; }
.mgb-owl.hop, .mgb-owl-s.hop { animation: mgHop .9s ease-in-out infinite; }
@keyframes mgBob { 50% { translate: 0 -5px; } }
@keyframes mgPop { 0% { scale: .9; } 60% { scale: 1.07; } 100% { scale: 1; } }
@keyframes mgHop { 0%, 100% { translate: 0 0; } 30% { translate: 0 -22px; } 60% { translate: 0 0; } 78% { translate: 0 -8px; } }
.mgb-bubble { position: absolute; left: 4px; top: 254px; width: 206px; z-index: 5; border-style: solid; border-width: 22px 18px 14px; border-image: url("../games/manh-ghep-bi-mat/frame-bubble.webp") 54 47 32 47 fill / 22px 18px 14px stretch;
  padding: 0 2px; font-size: 14.5px; font-weight: 700; color: var(--mgb-ink); line-height: 1.3; text-align: center; filter: drop-shadow(0 4px 5px rgba(0,0,0,.3)); transform-origin: 20% 100%; }
.mgb-bubble span { display: block; margin-top: -3px; }
.mgb-bubble.in { animation: mgIn .35s ease-out; }
.mgb-bubble[hidden], .mgb-toast[hidden], .mgb-modal[hidden], .mgb-note2[hidden], .mgb-guess em[hidden] { display: none; }
@keyframes mgIn { from { opacity: 0; transform: scale(.85) translateY(6px); } }
.mgb-chest { position: absolute; right: 8px; bottom: 28px; width: 112px; z-index: 3; filter: drop-shadow(0 5px 5px rgba(0,0,0,.35)); transition: filter .3s; }
.mgb-chest.open { animation: mgPop .6s ease-out; filter: drop-shadow(0 0 22px #ffd34d) drop-shadow(0 5px 5px rgba(0,0,0,.3)); }
.mgb-guess { position: absolute; left: 368px; bottom: 0; width: 224px; padding: 0; border: 0; background: none; cursor: pointer; z-index: 5; transition: transform .15s, filter .2s; }
.mgb-guess img { width: 100%; display: block; filter: drop-shadow(0 4px 5px rgba(0,0,0,.4)); }
.mgb-guess:not(.off) img { animation: mgBtnGlow 2.6s ease-in-out infinite; }
@keyframes mgBtnGlow { 50% { filter: drop-shadow(0 0 10px rgba(255,240,150,.95)) drop-shadow(0 4px 5px rgba(0,0,0,.4)); } }
.mgb-guess span { position: absolute; left: 33%; right: 6%; top: 30%; bottom: 30%; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 16.5px; line-height: 1.05; font-weight: 900; color: #fff; white-space: nowrap; text-shadow: 0 2px 0 #0d5a2a, 0 0 4px rgba(0,60,20,.8); }
.mgb-guess:hover { transform: scale(1.05); filter: brightness(1.08); }
.mgb-guess.off { filter: grayscale(.6) brightness(.92); }
.mgb-guess em { position: absolute; left: 50%; top: -4px; transform: translateX(-50%); white-space: nowrap; font-style: normal; font-size: 12px; font-weight: 800; color: #fff; background: rgba(60,35,10,.88); padding: 2px 10px; border-radius: 99px; }

/* Màn hình câu hỏi */
.mgb-logo-s { width: 118px; top: 4px; left: 8px; }
.mgb-p-piece { left: 276px; width: 132px; } .mgb-p-score2 { left: 414px; width: 132px; } .mgb-p-time { left: 552px; width: 132px; }
.mgb-p-piece b, .mgb-p-time b { font-size: 17px; }
.mgb-p-time.low b { color: #d4161f; animation: mgPulse .6s ease-in-out infinite; }
@keyframes mgPulse { 50% { transform: scale(1.12); } }
.mgb-qcol { position: absolute; left: 124px; top: 62px; width: 712px; height: 470px; display: flex; flex-direction: column; justify-content: center; gap: 10px; overflow: hidden; z-index: 2; --fq: 27px; --fa: 22px; }
.mgb-qcol.scroll { justify-content: flex-start; overflow-y: auto; scrollbar-width: thin; }
.mgb-qbox { flex: none; min-height: 96px; display: flex; align-items: center; justify-content: center; border-style: solid; border-width: 34px 29px 20px;
  border-image: url("../games/manh-ghep-bi-mat/frame-question.webp") 67 57 39 57 fill / 34px 29px 20px stretch; padding: 0 12px 4px; filter: drop-shadow(0 5px 6px rgba(0,0,0,.35)); }
.mgb-qt { font-size: var(--fq); line-height: 1.32; font-weight: 800; color: var(--mgb-ink); text-align: center; margin-top: -10px; overflow-wrap: anywhere; }
.mgb-cards { flex: none; display: flex; flex-direction: column; gap: 8px; }
.mgb-card { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; min-height: 54px; transition: transform .15s, opacity .3s; color: inherit; }
.mgb-cb { display: flex; align-items: center; min-height: 50px; margin: 0 26px 0 64px; padding: 6px 46px 6px 62px; background: linear-gradient(#fffaf0, #f6ead0); border: 4px solid var(--c); border-radius: 28px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.85), inset 0 -3px 0 rgba(120,80,20,.1), 0 3px 0 rgba(0,0,0,.28), 0 6px 10px rgba(0,0,0,.22); transition: border-color .2s, box-shadow .2s, filter .2s; }
.mgb-ct { font-size: var(--fa); line-height: 1.28; font-weight: 700; color: #3b2a14; overflow-wrap: anywhere; }
.mgb-cl { position: absolute; left: 0; top: 50%; height: 54px; transform: translateY(-50%); z-index: 1; filter: drop-shadow(0 3px 2px rgba(0,0,0,.25)); }
.mgb-key { position: absolute; left: 79px; top: 50%; transform: translateY(-50%); width: 32px; text-align: center; font-size: 25px; font-weight: 900; color: #6b3d0c; z-index: 2; }
.mgb-cr { position: absolute; right: 0; top: 50%; height: 48px; transform: translateY(-50%); filter: drop-shadow(0 3px 2px rgba(0,0,0,.25)); }
.mgb-badge { position: absolute; right: 34px; top: 50%; height: 40px; transform: translateY(-50%); z-index: 2; animation: mgPop .4s ease-out; }
.mgb-badge[hidden] { display: none; }
.mgb-card:not(:disabled):hover { transform: translateY(-2px); }
.mgb-card:not(:disabled):hover .mgb-cb { filter: brightness(1.04); box-shadow: inset 0 2px 0 rgba(255,255,255,.85), 0 0 0 3px rgba(255,255,255,.6), 0 6px 14px rgba(0,0,0,.28); }
.mgb-card:focus-visible { outline: none; } .mgb-card:focus-visible .mgb-cb { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--c); }
.mgb-card.right .mgb-cb { border-color: #19c814; background: linear-gradient(#f4fff0, #ddf8d2); box-shadow: 0 0 0 4px rgba(120,255,110,.55), 0 0 22px rgba(80,230,60,.7); }
.mgb-card.right.soft .mgb-cb { box-shadow: 0 0 0 3px rgba(120,255,110,.4); }
.mgb-card.wrong .mgb-cb { border-color: #e62020; background: linear-gradient(#fff6f4, #fde3dd); }
.mgb-card.wrong:disabled { opacity: .82; cursor: default; }
.mgb-card.shake { animation: mgShake .45s; }
@keyframes mgShake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.mgb-edit .mgb-card { cursor: default; pointer-events: none; }
.mgb-edit .mgb-card.key .mgb-cb { border-style: dashed; }
.mgb-img { max-height: 120px; max-width: 100%; vertical-align: middle; border-radius: 8px; margin: 2px; }
.mgb-ct .mgb-img { max-height: 70px; }
.mgb-frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .82em; line-height: 1.05; margin: 0 2px; }
.mgb-frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 3px; }
.mgb-ov { border-top: 2px solid currentColor; padding: 0 2px; }
.mgb-owl-s { position: absolute; left: 2px; bottom: 4px; height: 112px; z-index: 3; transform-origin: 50% 100%; filter: drop-shadow(0 3px 3px rgba(0,0,0,.3)); }
.mgb-owl-s.pop { animation: mgPop .5s ease-out; }
.mgb-back { position: absolute; right: 8px; bottom: 6px; width: 56px; padding: 0; border: 0; background: none; cursor: pointer; z-index: 3; transition: transform .15s; }
.mgb-back img { width: 100%; filter: drop-shadow(0 3px 3px rgba(0,0,0,.35)); }
.mgb-back:hover { transform: scale(1.08); }

/* Thông báo, hộp thoại */
.mgb-toast { position: absolute; left: 50%; top: 50%; width: 400px; transform: translate(-50%, -50%); z-index: 20; border-style: solid; border-width: 64px 20px 18px 19px;
  border-image: url("../games/manh-ghep-bi-mat/note-retry.webp") 116 37 33 35 fill / 64px 20px 18px 19px stretch; padding: 0 14px 8px; text-align: center; filter: drop-shadow(0 8px 14px rgba(0,0,0,.4)); }
.mgb-toast.mgb-n-ok { border-image-source: url("../games/manh-ghep-bi-mat/note-ok.webp"); }
.mgb-toast.in { animation: mgToast .4s cubic-bezier(.2,1.4,.5,1); }
@keyframes mgToast { from { opacity: 0; transform: translate(-50%, -50%) scale(.7); } }
.mgb-nt { font-size: 21px; font-weight: 800; color: var(--mgb-ink); line-height: 1.3; }
.mgb-nb { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.mgb-btn { border: 0; border-radius: 14px; padding: 9px 20px; font-size: 17px; font-weight: 800; color: #fff; cursor: pointer; background: linear-gradient(#3fc85a, #16934a); box-shadow: inset 0 2px 0 rgba(255,255,255,.4), 0 3px 0 #0b5e2c; text-shadow: 0 1px 1px rgba(0,0,0,.35); transition: transform .12s, filter .12s; }
.mgb-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.mgb-btn2 { background: linear-gradient(#ffd04a, #eb9f0c); box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 3px 0 #a5620a; color: #5a2f00; text-shadow: none; }
.mgb-btn.mgb-no { background: linear-gradient(#ff8a6a, #e2493a); box-shadow: inset 0 2px 0 rgba(255,255,255,.4), 0 3px 0 #9d2a1f; }
.mgb-modal { position: absolute; inset: 0; z-index: 25; display: grid; place-items: center; background: rgba(8,30,16,.5); animation: mgFade .25s; }
@keyframes mgFade { from { opacity: 0; } }
.mgb-dlg { width: 580px; border-style: solid; border-width: 70px 22px 20px 21px; border-image: url("../games/manh-ghep-bi-mat/note-guess.webp") 117 36 33 35 fill / 70px 22px 20px 21px stretch;
  padding: 0 18px 10px; text-align: center; color: var(--mgb-ink); filter: drop-shadow(0 10px 18px rgba(0,0,0,.45)); animation: mgToastD .4s cubic-bezier(.2,1.4,.5,1); }
@keyframes mgToastD { from { opacity: 0; transform: scale(.75); } }
.mgb-dlg h3 { margin: -2px 0 4px; font-size: 26px; font-weight: 900; color: #8a4b0a; }
.mgb-dlg p { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.mgb-gl { display: inline-block; margin-bottom: 8px; font-size: 13px; font-weight: 800; color: #fff; background: #b8741a; border-radius: 99px; padding: 2px 12px; }
.mgb-gform { display: flex; gap: 8px; margin: 4px 0 10px; }
.mgb-gin { flex: 1; min-width: 0; font: inherit; font-size: 22px; font-weight: 700; color: var(--mgb-ink); padding: 8px 14px; border: 3px solid #c99a3a; border-radius: 14px; background: #fffdf5; outline: none; user-select: text; -webkit-user-select: text; }
.mgb-gin:focus { border-color: #2a9a4a; box-shadow: 0 0 0 3px rgba(42,154,74,.25); }
.mgb-gt { border-top: 2px dashed rgba(150,100,30,.35); padding-top: 8px; margin-bottom: 8px; }
.mgb-gt > span { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; color: #7a5520; }
.mgb-gbs { display: flex; gap: 10px; justify-content: center; }
.mgb-gc { margin-top: 2px; }
.mgb-note2 { position: absolute; left: 50%; top: 58px; transform: translateX(-50%); z-index: 28; background: rgba(30,20,5,.85); color: #fff; font-size: 14px; font-weight: 700; padding: 6px 16px; border-radius: 10px; }

/* Hiệu ứng (ảnh ánh sáng hoà màu kiểu screen) */
.mgb-fxl { position: absolute; inset: 0; z-index: 15; pointer-events: none; overflow: hidden; }
.mgb-fx { position: absolute; mix-blend-mode: screen; animation: mgFx 900ms ease-out forwards; pointer-events: none; }
@keyframes mgFx { 0% { opacity: 0; transform: scale(.35) rotate(-10deg); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.25) rotate(12deg); } }
.mgb-fx.rise { animation-name: mgFxRise; }
@keyframes mgFxRise { 0% { opacity: 0; transform: translateY(30px) scale(.5); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-60px) scale(1.2); } }
.mgb-fx.tint-blue { filter: none; } .mgb-fx.tint-green { filter: hue-rotate(-115deg); } .mgb-fx.tint-yellow { filter: hue-rotate(-162deg) saturate(1.4); }
.mgb-fx.tint-orange { filter: hue-rotate(175deg) saturate(1.3); } .mgb-fx.tint-purple { filter: hue-rotate(62deg); } .mgb-fx.tint-pink { filter: hue-rotate(118deg); }
.mgb-plus { position: absolute; z-index: 16; display: flex; align-items: center; gap: 4px; font-size: 40px; font-weight: 900; color: #ffd23a; -webkit-text-stroke: 2px #8a4a00; text-shadow: 0 3px 0 #8a4a00; animation: mgPlus 1.4s ease-out forwards; }
.mgb-plus img { width: 40px; }
@keyframes mgPlus { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 20% { opacity: 1; transform: translateY(0) scale(1.1); } 100% { opacity: 0; transform: translateY(-110px) scale(1); } }

/* Màn hình tổng kết */
.mgb-logo-win { position: absolute; left: 362px; top: -4px; width: 236px; z-index: 3; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); animation: mgPop .7s ease-out; }
.mgb-trophy { position: absolute; left: 280px; top: 26px; width: 76px; z-index: 3; animation: mgBob 2.6s ease-in-out infinite; filter: drop-shadow(0 4px 5px rgba(0,0,0,.3)); }
.mgb-star1 { position: absolute; left: 610px; top: 34px; width: 62px; z-index: 3; animation: mgSpin 4s ease-in-out infinite; filter: drop-shadow(0 4px 5px rgba(0,0,0,.3)); }
@keyframes mgSpin { 50% { transform: rotate(14deg) scale(1.08); } }
.mgb-spic { position: absolute; left: 165px; top: 155px; width: 387px; height: 221px; z-index: 1; overflow: hidden; background: #24412c; }
.mgb-spic svg { width: 100%; height: 100%; display: block; }
.mgb-automarks path { fill: none; stroke: #fff; stroke-width: 5; stroke-dasharray: 16 12; stroke-opacity: .9; }
.mgb-sframe { position: absolute; left: 124px; top: 106px; width: 470px; z-index: 2; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); }
.mgb-sname { position: absolute; left: 124px; top: 420px; width: 470px; z-index: 3; border-style: solid; border-width: 26px 24px 14px; border-image: url("../games/manh-ghep-bi-mat/frame-bar.webp") 64 54 34 54 fill / 26px 24px 14px stretch;
  text-align: center; padding: 0 6px 2px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }
.mgb-sname b { display: block; margin-top: -4px; font-size: 22px; font-weight: 900; color: #6b2f05; line-height: 1.2; }
.mgb-sname span { display: block; font-size: var(--fm, 13.5px); font-weight: 600; color: #6b4a20; line-height: 1.3; margin-top: 2px; }
.mgb-res { position: absolute; left: 606px; top: 102px; width: 344px; z-index: 3; border-style: solid; border-width: 56px 23px 21px; border-image: url("../games/manh-ghep-bi-mat/note-result.webp") 108 44 41 44 fill / 56px 23px 21px stretch;
  padding: 0 10px 4px; color: var(--mgb-ink); filter: drop-shadow(0 8px 12px rgba(0,0,0,.35)); animation: mgIn .5s ease-out; }
.mgb-rtot { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 2px 0 6px; }
.mgb-rtot img { height: 56px; }
.mgb-rtot small { display: block; font-size: 14px; font-weight: 700; color: #8a5a1a; }
.mgb-rtot b { display: block; font-size: 38px; font-weight: 900; color: #d27b00; line-height: 1; text-shadow: 0 2px 0 rgba(120,60,0,.2); }
.mgb-res ul { list-style: none; margin: 0; padding: 0; }
.mgb-res li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 3px 4px; border-bottom: 2px dotted rgba(150,100,30,.3); font-size: 14.5px; font-weight: 600; }
.mgb-res li b { font-size: 16px; font-weight: 900; color: #5a3510; white-space: nowrap; } .mgb-res li b.ok { color: #13853f; } .mgb-res li b.no { color: #c22543; }
.mgb-legend { margin-top: 6px; font-size: 11.5px; color: #7a5520; display: flex; align-items: center; gap: 6px; }
.mgb-legend i { flex: none; width: 22px; height: 0; border-top: 3px dashed #b07a2a; }
.mgb-owl-w { position: absolute; left: 0; bottom: 2px; height: 150px; z-index: 4; transform-origin: 50% 100%; animation: mgHop 1.1s ease-in-out infinite; filter: drop-shadow(0 4px 4px rgba(0,0,0,.3)); }
.mgb-sbtn { position: absolute; left: 600px; top: 452px; display: flex; gap: 10px; z-index: 4; }
.mgb-wbtn { position: relative; width: 170px; padding: 0; border: 0; background: none; cursor: pointer; transition: transform .15s, filter .15s; }
.mgb-wbtn img { width: 100%; display: block; filter: drop-shadow(0 4px 5px rgba(0,0,0,.35)); }
.mgb-wbtn span { position: absolute; left: 36%; right: 7%; top: 30%; bottom: 30%; display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 #8a4a00, 0 0 3px #8a4a00; }
.mgb-wbtn:hover, .mgb-wbtn:focus-visible { transform: scale(1.05); filter: brightness(1.07) drop-shadow(0 0 8px #fff6b0); }
.mgb-wbtn:focus { outline: none; }
.mgb-fall { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.mgb-fall img { position: absolute; top: -50px; opacity: .95; animation: mgFall linear infinite; }
@keyframes mgFall { 0% { transform: translateY(0) rotate(0); } 100% { transform: translateY(640px) rotate(var(--r, 360deg)); } }
@media (prefers-reduced-motion: reduce) { .mgb-owl, .mgb-owl-w, .mgb-trophy, .mgb-star1, .mgb-guess:not(.off) img { animation: none !important; } }

/* Trang soạn: thiết lập riêng Mảnh ghép bí mật */
.mgb-set { display: flex; flex-direction: column; gap: 10px; }
.mgb-set[hidden] { display: none; }
.mgb-set .ge-input, .mgb-set textarea.ge-input { width: 100%; box-sizing: border-box; }
.mgb-set textarea.ge-input { min-height: 54px; resize: vertical; font: inherit; font-size: 13.5px; padding: 8px 10px; }
.mgb-upl { display: flex; gap: 10px; align-items: center; }
.mgb-thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #e8eef7 center / cover; border: 1px solid var(--border-soft, #dfe6f1); }
.mgb-thumb svg { width: 100%; height: 100%; display: block; }
.mgb-thumb .mgb-tag { position: absolute; left: 8px; top: 8px; background: rgba(20,32,60,.75); color: #fff; font-size: 11.5px; padding: 2px 8px; border-radius: 99px; }
.mgb-small { font-size: 12px; color: var(--text-muted, #6b7a90); line-height: 1.4; }
.mgb-crop-back { position: fixed; inset: 0; z-index: 200; background: rgba(15,25,45,.6); display: grid; place-items: center; }
.mgb-crop { background: #fff; border-radius: 16px; padding: 16px 18px; width: min(760px, calc(94vw * var(--vz, 1))); box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.mgb-crop h3 { margin: 0 0 4px; font-size: 18px; color: var(--text-strong, #1b2a44); }
.mgb-crop p { margin: 0 0 10px; font-size: 13px; color: var(--text, #4a5a74); }
.mgb-crop-view { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: #222; cursor: grab; touch-action: none; }
.mgb-crop-view:active { cursor: grabbing; }
.mgb-crop-view svg { width: 100%; height: 100%; display: block; }
.mgb-crop-row { display: flex; align-items: center; gap: 12px; margin: 12px 0; font-size: 13.5px; }
.mgb-crop-row input[type=range] { flex: 1; }
.mgb-crop-act { display: flex; justify-content: flex-end; gap: 10px; }

/* =========================================================
   Thủ môn đỡ bóng (tiền tố tm-) – sân khấu 1280×720, co giãn giữ tỉ lệ
   ========================================================= */
.ge-stage .tm-host, .gp-host.tm-host { position: absolute; inset: 0; }
.tm-host { overflow: hidden; background: #2a7fd6; font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; user-select: none; -webkit-user-select: none;
  --tm-ink: #3a2808; --tm-navy: #0d2f73; }
.tm-backdrop { position: absolute; inset: -30px; background: url("../games/thu-mon-do-bong/bg-day.jpg") center / cover; filter: blur(18px) brightness(.7); }
.tm-night .tm-backdrop { background-image: url("../games/thu-mon-do-bong/bg-night.jpg"); }
.tm-layer { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; overflow: hidden; }
.tm-layer img { -webkit-user-drag: none; max-width: none; max-height: none; }
.tm-scr { position: absolute; inset: 0; display: none; }
.tm-scr.on { display: block; }
.tm-bg { position: absolute; left: 0; top: 0; width: 1434px; height: auto; transition: transform .45s ease; pointer-events: none; }
.tm-loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10,40,90,.55); color: #fff; font-size: 26px; font-weight: 800; z-index: 50; }
.tm-paused .tm-fx, .tm-paused .tm-netw, .tm-paused .tm-pill, .tm-paused .tm-msg, .tm-paused .tm-combo, .tm-paused .tm-ready .tm-keeper, .tm-paused .tm-fall i { animation-play-state: paused !important; }

/* ----- sân thi đấu: một hệ toạ độ, thứ tự lớp: nền → lưới → khung → bóng đổ → thủ môn → bóng → hiệu ứng ----- */
.tm-field { position: absolute; left: 0; top: 0; width: 1280px; height: 376px; transform-origin: 0 0; transition: transform .35s ease; pointer-events: none; }
.tm-field > * { position: absolute; left: 0; top: 0; }
.tm-gshadow { left: 352px; top: 254px; width: 580px; opacity: .55; }
.tm-netw { left: 352.4px; top: 58.4px; width: 574.4px; height: 230px; transform-origin: 50% 0; }
.tm-netw img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.tm-net-hit { opacity: 0; transition: opacity .25s; }
.tm-netw.shake.l { animation: tm-net-l .6s ease-out; }
.tm-netw.shake.r { animation: tm-net-r .6s ease-out; }
@keyframes tm-net-l { 0% { transform: none; } 20% { transform: skewX(-3deg) scale(1.025, 1.03) translateX(-6px); } 45% { transform: skewX(2deg) scale(.99, .99) translateX(3px); } 70% { transform: skewX(-1deg) translateX(-1px); } 100% { transform: none; } }
@keyframes tm-net-r { 0% { transform: none; } 20% { transform: skewX(3deg) scale(1.025, 1.03) translateX(6px); } 45% { transform: skewX(-2deg) scale(.99, .99) translateX(-3px); } 70% { transform: skewX(1deg) translateX(1px); } 100% { transform: none; } }
.tm-goal { left: 340px; top: 0; width: 600px; filter: drop-shadow(0 3px 3px rgba(0,0,0,.25)); }
.tm-spot { left: 617px; top: 337px; width: 46px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 0 4px rgba(255,255,255,.6); }
.tm-kshadow { left: -75px; top: -11px; width: 150px; height: 22px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,30,0,.45), rgba(0,30,0,0)); }
.tm-keeper { width: 1px; height: 1px; }
.tm-pose { position: absolute; left: 0; top: 0; opacity: 0; will-change: transform, opacity; }
.tm-ready .tm-keeper { animation: tm-bob 1.1s ease-in-out infinite; }
@keyframes tm-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
.tm-bshadow { width: 152px; height: 43px; transform-origin: 76px 21px; opacity: 0; }
.tm-trail { width: 306px; height: 142px; opacity: 0; mix-blend-mode: screen; }
.tm-ball { width: 150px; height: 150px; transform-origin: 75px 75px; will-change: transform; }
.tm-ball img { width: 150px; height: 150px; display: block; filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); }
.tm-fxf { width: 1280px; height: 376px; }
.tm-fx { position: absolute; height: auto; pointer-events: none; animation: tm-fx-pop .6s ease-out forwards; }
.tm-fx.pop { animation-name: tm-fx-pop; }
.tm-fx.sun { animation-name: tm-fx-sun; mix-blend-mode: screen; }
.tm-fx.spark { animation-name: tm-fx-spark; }
.tm-fx.dust { animation-name: tm-fx-dust; transform-origin: 50% 90%; }
.tm-fx.dust.flip { animation-name: tm-fx-dustf; }
.tm-fx.ripple { animation-name: tm-fx-ripple; }
@keyframes tm-fx-pop { 0% { transform: scale(.3); opacity: 0; } 25% { opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes tm-fx-sun { 0% { transform: scale(.4) rotate(0); opacity: 0; } 30% { opacity: .9; } 100% { transform: scale(1.15) rotate(40deg); opacity: 0; } }
@keyframes tm-fx-spark { 0% { transform: scale(.6); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1.1) translateY(-14px); opacity: 0; } }
@keyframes tm-fx-dust { 0% { transform: translateY(-60%) scale(.4); opacity: 0; } 25% { opacity: .95; } 100% { transform: translateY(-60%) scale(1.1); opacity: 0; } }
@keyframes tm-fx-dustf { 0% { transform: translateY(-60%) scale(-.4, .4); opacity: 0; } 25% { opacity: .95; } 100% { transform: translateY(-60%) scale(-1.1, 1.1); opacity: 0; } }
@keyframes tm-fx-ripple { 0% { transform: scale(.4); opacity: 0; } 25% { opacity: .95; } 100% { transform: scale(1.3); opacity: 0; } }

/* ----- thanh thông tin (≈8%) – theo ảnh giao diện mẫu ----- */
.tm-hud { position: absolute; left: 0; right: 0; top: 0; height: 60px; display: flex; align-items: center; gap: 9px; padding: 0 10px;
  background: linear-gradient(180deg, rgba(8,34,92,.62), rgba(8,34,92,0)); z-index: 5; }
.tm-brand { flex: none; position: relative; width: 156px; height: 60px; margin-right: 2px; }
.tm-brand img { position: absolute; left: 0; display: block; width: auto; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); }
.tm-logo { top: 0; height: 72px; }
.tm-logo-s { top: 2px; height: 56px; display: none !important; }
.tm-hud.tm-tight .tm-brand { width: 76px; }
.tm-hud.tm-tight .tm-logo { display: none; }
.tm-hud.tm-tight .tm-logo-s { display: block !important; }
.tm-pill { position: relative; flex: none; height: 42px; box-sizing: border-box; display: flex; align-items: center; padding: 0 16px 0 44px; border-radius: 99px;
  border: 3px solid #0d2a6e; background: linear-gradient(180deg, #4c95ff, #1a5fdc 55%, #1450c4);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.16), 0 2px 5px rgba(0,0,0,.3); }
.tm-pill img { position: absolute; left: 1px; top: 50%; height: 38px; width: auto; transform: translateY(-50%); display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
.tm-pill b { color: #fff; font-size: 20px; font-weight: 900; white-space: nowrap; letter-spacing: .2px; text-shadow: 0 2px 0 rgba(0,30,90,.55); font-variant-numeric: tabular-nums; }
.tm-p-score { background: linear-gradient(180deg, #ff6b5b, #e5262a 55%, #c81d22); border-color: #6b0d12; }
.tm-p-score b { text-shadow: 0 2px 0 rgba(110,10,10,.6); }
.tm-p-time { min-width: 128px; }
.tm-p-time.warn b { color: #ffe14d; animation: tm-warn .5s ease-in-out infinite alternate; display: inline-block; }
@keyframes tm-warn { to { transform: scale(1.12); } }
.tm-pill.bump { animation: tm-bump .45s ease-out; }
@keyframes tm-bump { 40% { transform: scale(1.12); } }
.tm-hearts { display: flex; align-items: center; gap: 1px; height: 40px; padding: 0 7px; background: rgba(8,30,80,.45); border: 2px solid rgba(255,255,255,.35); border-radius: 22px; color: #fff; font-weight: 900; font-size: 20px; flex: none; }
.tm-hearts img { height: 27px; width: auto; }
.tm-hearts img.pop { animation: tm-heart .6s ease-out; }
@keyframes tm-heart { 30% { transform: scale(1.5) rotate(-10deg); } 100% { transform: scale(1); } }
.tm-hearts b { margin-left: 4px; }
.tm-mode { background: linear-gradient(180deg, #5fd85a, #26a334 55%, #1d8c2b); border-color: #0d4a16; }
.tm-mode b { text-shadow: 0 2px 0 rgba(10,70,20,.6); }
.tm-mode.ch { background: linear-gradient(180deg, #ffab3d, #f07a12 55%, #d9650a); border-color: #6b3000; }
.tm-tools { margin-left: auto; display: flex; gap: 7px; align-items: center; }
.tm-tool { border: 0; background: none; padding: 0; cursor: pointer; height: 44px; transition: transform .15s; }
.tm-tool img { height: 44px; width: auto; display: block; }
.tm-tool:hover { transform: translateY(-2px) scale(1.06); }
.tm-tool:active { transform: scale(.94); }
.tm-edit .tm-tool { pointer-events: none; }

/* ----- khung câu hỏi: rộng 95%, cao theo nội dung, 3 mẫu khung 9-slice ----- */
.tm-q { position: absolute; left: 32px; width: 1216px; top: 66px; box-sizing: border-box; min-height: 78px; padding: 6px 22px 8px;
  border: 18px solid transparent; border-image: url("../games/thu-mon-do-bong/q-frame-1.webp") 54 fill / 28px stretch; display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.25)); z-index: 3; --qf: 30px; }
.tm-q[data-frame="2"] { border-image-source: url("../games/thu-mon-do-bong/q-frame-2.webp"); border-image-slice: 64 fill; }
.tm-q[data-frame="3"] { border-image-source: url("../games/thu-mon-do-bong/q-frame-3.webp"); border-image-slice: 70 fill; }
.tm-qt { width: 100%; color: #1a2350; font-size: var(--qf); line-height: 1.32; font-weight: 800; text-align: center; overflow-wrap: anywhere; }
.tm-q[data-lines="2"] .tm-qt, .tm-q[data-frame="3"] .tm-qt { text-align: left; }
.tm-qt .tm-img, .tm-ct .tm-img { max-height: 150px; max-width: 34%; float: right; margin: 0 0 4px 16px; border-radius: 10px; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.tm-ct .tm-img { max-height: 64px; float: none; vertical-align: middle; margin: 0 6px; }
.tm-frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .82em; line-height: 1.1; margin: 0 .12em; }
.tm-frac > span:first-child { border-bottom: .09em solid currentColor; padding: 0 .15em; }
.tm-ov { border-top: .08em solid currentColor; padding-top: .05em; }
.tm-qt sup, .tm-ct sup, .tm-qt sub, .tm-ct sub { font-size: .66em; }

/* ----- thẻ đáp án 2×2 (theo ảnh mẫu): nền kem, viền màu, ô chữ cái màu – A xanh dương · B vàng cam · C xanh lá · D tím ----- */
.tm-cards { position: absolute; left: 16px; width: 1248px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; row-gap: 12px; z-index: 3; --cf: 26px; }
.tm-card { --cc: #1f74e8; --cd: #0d4fb8; --cg: linear-gradient(180deg, #4d9bff, #1a62e0);
  position: relative; box-sizing: border-box; min-height: 74px; display: flex; align-items: center; gap: 16px; padding: 7px 22px 7px 12px; margin: 0;
  border: 5px solid var(--cc); border-radius: 20px; background: linear-gradient(180deg, #fffaea, #fbf0cf); cursor: pointer; text-align: left; font: inherit; color: #17204a;
  box-shadow: 0 0 0 2px rgba(255,255,255,.85), 0 4px 0 var(--cd), 0 7px 12px rgba(0,0,0,.28); transition: transform .15s ease, box-shadow .2s ease, background .2s ease; }
.tm-c-yellow { --cc: #f4bd17; --cd: #b98500; --cg: linear-gradient(180deg, #ffb340, #f08a00); }
.tm-c-green { --cc: #2cbb2c; --cd: #17801b; --cg: linear-gradient(180deg, #4fd84a, #1d9c22); }
.tm-c-purple { --cc: #9a3be6; --cd: #6a1fae; --cg: linear-gradient(180deg, #b45ef5, #7d2bd1); }
.tm-key { flex: none; width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: var(--cg); color: #fff; font-size: 31px; font-weight: 900;
  text-shadow: 0 2px 0 rgba(0,0,0,.25); box-shadow: inset 0 3px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.18), 0 2px 3px rgba(0,0,0,.25); }
.tm-ct { flex: 1; min-width: 0; font-size: var(--cf); line-height: 1.3; font-weight: 800; text-align: center; overflow-wrap: anywhere; padding: 2px 0; }
.tm-card.tm-long .tm-ct { text-align: left; }
.tm-card:hover:not(.off) { transform: translateY(-3px); box-shadow: 0 0 0 2px #fff, 0 7px 0 var(--cd), 0 12px 16px rgba(0,0,0,.3); }
.tm-card:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }
.tm-card.sel { transform: scale(1.02); background: linear-gradient(180deg, #fff, #fff6dc); box-shadow: 0 0 0 4px #fff, 0 0 18px 6px color-mix(in srgb, var(--cc) 75%, transparent), 0 4px 0 var(--cd); }
.tm-card.right { --cc: #1faa3b; --cd: #0f7a26; --cg: linear-gradient(180deg, #45d35a, #18a032); background: linear-gradient(180deg, #effde9, #d6f5cc); padding-right: 64px; animation: tm-right .6s ease-out; }
.tm-card.wrong, .tm-card.off { --cc: #e0352b; --cd: #a51d16; --cg: linear-gradient(180deg, #ff6a5c, #d9261d); background: linear-gradient(180deg, #fff0ec, #fbd9d1); padding-right: 64px; }
.tm-card.right::before, .tm-card.wrong::before, .tm-card.off::before { position: absolute; right: 12px; top: 50%; width: 40px; height: 40px; margin-top: -20px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 26px; font-weight: 900; background: var(--cg); box-shadow: 0 2px 3px rgba(0,0,0,.25); }
.tm-card.right::before { content: "✓"; }
.tm-card.wrong::before, .tm-card.off::before { content: "✗"; }
.tm-card.wrong { animation: tm-wrong .45s ease-in-out; }
.tm-card.off { opacity: .72; cursor: not-allowed; }
.tm-card.dim { filter: saturate(.5) brightness(.93); }
.tm-cards.tm-lock .tm-card { cursor: default; pointer-events: none; }
.tm-card.key::after { content: "Đáp án đúng"; position: absolute; right: 14px; top: -11px; z-index: 2; line-height: 18px; background: #16a34a; color: #fff; font-size: 13px; font-weight: 800; padding: 2px 10px; border-radius: 99px; }
@keyframes tm-right { 30% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes tm-wrong { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* ----- thông báo ----- */
.tm-msg { position: absolute; left: 50%; top: 300px; transform: translateX(-50%); z-index: 6; height: 64px; display: flex; align-items: center; pointer-events: none; }
.tm-msg img { height: 64px; width: auto; }
.tm-msg span { position: absolute; left: 78px; right: 26px; top: 0; bottom: 3px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 900; color: #2d5a06; white-space: nowrap; }
.tm-msg.tm-m-no span { color: #9a3b05; }
.tm-msg span b { margin-left: 8px; color: #e07b00; font-size: 26px; }
.tm-msg.in { animation: tm-msg .4s ease-out; }
@keyframes tm-msg { from { transform: translateX(-50%) scale(.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.tm-msg img { width: auto; height: 64px; }
.tm-combo { position: absolute; right: 60px; top: 150px; z-index: 6; padding: 8px 18px; border-radius: 16px; background: linear-gradient(#ffcf3a, #ff9a1a); color: #6b3500; font-weight: 900; font-size: 22px;
  box-shadow: 0 4px 0 #c86a00, 0 8px 14px rgba(0,0,0,.25); pointer-events: none; }
.tm-combo b { color: #fff; text-shadow: 0 2px 0 #b35a00; }
.tm-combo.in { animation: tm-msg2 .5s ease-out; }
@keyframes tm-msg2 { from { transform: scale(.5) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.tm-next { position: absolute; right: 24px; bottom: 16px; z-index: 7; }
.tm-note { position: absolute; left: 50%; top: 80px; transform: translateX(-50%); z-index: 40; background: rgba(10,30,70,.88); color: #fff; padding: 10px 20px; border-radius: 12px; font-size: 18px; font-weight: 700; }
.tm-pause { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(6,20,52,.6); backdrop-filter: blur(3px); }
.tm-pbox { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #fff; text-align: center; }
.tm-pbox b { font-size: 56px; font-weight: 900; text-shadow: 0 4px 0 #0d2f73; }
.tm-pbox span { font-size: 20px; opacity: .9; }
.tm-resume { margin-top: 12px; display: flex; align-items: center; gap: 12px; border: 0; cursor: pointer; padding: 8px 26px 8px 8px; border-radius: 99px; background: #fff; color: var(--tm-navy); font: inherit; font-size: 22px; font-weight: 900; }
.tm-resume img { height: 48px; }

/* ----- màn hình tổng kết ----- */
.tm-sbg { position: absolute; left: -77px; top: -40px; width: 1434px; height: auto; }
.tm-glow { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(255,215,120,.35), rgba(255,215,120,0) 60%), linear-gradient(180deg, rgba(10,20,60,.15), rgba(10,20,60,.45)); }
.tm-logo-win { position: absolute; left: 50%; top: 2px; width: 290px; transform: translateX(-50%); filter: drop-shadow(0 4px 8px rgba(0,0,0,.35)); animation: tm-drop .7s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes tm-drop { from { transform: translateX(-50%) translateY(-60px) scale(.7); opacity: 0; } }
.tm-stitle { position: absolute; left: 60px; width: 700px; top: 160px; text-align: center; color: #fff; text-shadow: 0 3px 0 rgba(10,30,90,.7), 0 0 12px rgba(10,30,90,.5); animation: tm-rise .6s .1s ease-out both; }
.tm-stitle b { display: block; font-size: 32px; font-weight: 900; line-height: 1.15; color: #ffe56b; }
.tm-stitle span { display: block; font-size: 18px; font-weight: 700; margin-top: 2px; }
.tm-board { position: absolute; left: 90px; top: 222px; width: 640px; height: 410px; animation: tm-rise .6s .2s ease-out both; }
.tm-board-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tm-bin { position: absolute; left: 54px; right: 54px; top: 98px; bottom: 40px; display: flex; flex-direction: column; gap: 8px; color: var(--tm-navy); }
.tm-total { display: flex; align-items: center; gap: 12px; padding: 4px 14px; background: rgba(255,255,255,.65); border-radius: 14px; }
.tm-total > img { height: 64px; }
.tm-total small { display: block; font-size: 15px; font-weight: 700; color: #6b5a2e; }
.tm-total b { font-size: 40px; font-weight: 900; line-height: 1; color: #d47a00; }
.tm-total em { display: block; font-size: 12.5px; font-style: normal; color: #8a6a2e; }
.tm-rate { margin-left: auto; text-align: right; }
.tm-rate b { font-size: 34px; color: #1a8c2c; }
.tm-bin ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.tm-bin li { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 700; border-bottom: 2px dotted rgba(13,47,115,.18); padding: 3px 2px; }
.tm-bin li b { font-size: 20px; font-weight: 900; }
.tm-bin li b.ok { color: #1a8c2c; } .tm-bin li b.no { color: #d0451b; }
.tm-bin li:last-child { grid-column: 1 / -1; }
.tm-stars { position: absolute; left: 820px; width: 400px; top: 160px; display: flex; justify-content: center; gap: 8px; }
.tm-stars img { width: 74px; filter: grayscale(1) brightness(.75) opacity(.55); }
.tm-stars img.on { filter: drop-shadow(0 0 10px rgba(255,220,80,.8)); animation: tm-star .6s cubic-bezier(.2,1.6,.4,1) both; }
.tm-stars img:nth-child(2) { width: 92px; margin-top: -14px; }
@keyframes tm-star { from { transform: scale(0) rotate(-90deg); } }
.tm-podium { position: absolute; left: 840px; top: 545px; width: 360px; }
.tm-champ { position: absolute; left: 920px; top: 248px; height: 330px; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); animation: tm-champ 1s .3s cubic-bezier(.2,1.4,.4,1) both, tm-float 2.4s 1.3s ease-in-out infinite; }
@keyframes tm-champ { from { transform: translateY(80px) scale(.6); opacity: 0; } }
@keyframes tm-float { 50% { transform: translateY(-8px); } }
@keyframes tm-rise { from { transform: translateY(40px); opacity: 0; } }
.tm-sbtn { position: absolute; left: 60px; width: 700px; top: 643px; display: flex; justify-content: center; gap: 26px; }
.tm-wbtn { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 28px 0 6px; border: 0; border-radius: 99px; cursor: pointer; font: inherit; font-size: 24px; font-weight: 900;
  color: #fff; background: linear-gradient(#2a8cff, #0a5ad8); box-shadow: 0 5px 0 #073e9a, 0 10px 18px rgba(0,0,0,.3); transition: transform .15s; }
.tm-wbtn img { height: 54px; }
.tm-wbtn[data-a="replay"] { background: linear-gradient(#3fd06a, #14a33f); box-shadow: 0 5px 0 #0b7a2a, 0 10px 18px rgba(0,0,0,.3); }
.tm-wbtn:hover { transform: translateY(-3px); }
.tm-fall i { position: absolute; top: -30px; border-radius: 3px; animation: tm-fall linear infinite; opacity: .9; }
@keyframes tm-fall { to { transform: translateY(780px) rotate(var(--r)); } }
.tm-sfx .tm-fx { animation-name: tm-fx-pop; }
.tm-host [hidden] { display: none !important; }

/* =========================================================
   Giải cứu đại dương (tiền tố gc-) – sân khấu 1280×720, bản đồ cuộn ngang 3801 px
   ========================================================= */
.ge-stage .gc-host, .gp-host.gc-host { position: absolute; inset: 0; }
.gc-host { overflow: hidden; background: #0b5fa6; font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; user-select: none; -webkit-user-select: none; --gc-ink: #12406b; --gc-navy: #0b2f5c; }
.gc-host [hidden] { display: none !important; }
.gc-backdrop { position: absolute; inset: -30px; background: url("../games/giai-cuu-dai-duong/bg-ocean.jpg") 20% center / cover; filter: blur(18px) brightness(.65); }
.gc-layer { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; overflow: hidden; }
.gc-layer img { -webkit-user-drag: none; max-width: none; max-height: none; }
.gc-scr { position: absolute; inset: 0; display: none; }
.gc-scr.on { display: block; }
.gc-loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5,40,90,.6); color: #fff; font-size: 26px; font-weight: 800; z-index: 60; }
.gc-paused .gc-fx, .gc-paused .gc-cr-in, .gc-paused .gc-cr-in img, .gc-paused .gc-rb-in, .gc-paused .gc-trash img, .gc-paused .gc-wd, .gc-paused .gc-snow, .gc-paused .gc-coral.glow img, .gc-paused .gc-msg { animation-play-state: paused !important; }

/* ----- thế giới: nền panorama + lớp màu nước + đối tượng ----- */
.gc-world { position: absolute; left: 0; top: 0; width: 3801px; height: 720px; z-index: 1; will-change: transform; pointer-events: none; }
.gc-world > * { position: absolute; left: 0; top: 0; }
.gc-bg { left: 0; }
.gc-tint { width: 3801px; height: 720px; background: linear-gradient(90deg, rgba(0,0,0,0) 0, rgba(0,0,0,0) 1900px, rgba(48,22,128,.32) 2300px, rgba(36,12,100,.42) 2800px, rgba(20,40,120,.12) 3150px, rgba(0,0,0,0) 3350px); }
.gc-murk { top: 120px; height: 470px; opacity: .9; transition: opacity 1.1s ease; }
.gc-murk[data-z="0"] { left: 380px; width: 1000px; background: radial-gradient(ellipse 50% 50% at 50% 55%, rgba(98,104,58,.55), rgba(98,104,58,.3) 55%, rgba(98,104,58,0) 100%); }
.gc-murk[data-z="1"] { left: 850px; width: 900px; background: radial-gradient(ellipse 50% 50% at 50% 55%, rgba(92,100,60,.5), rgba(92,100,60,.26) 55%, rgba(92,100,60,0) 100%); }
.gc-murk[data-z="2"] { left: 1480px; width: 900px; background: radial-gradient(ellipse 50% 50% at 50% 55%, rgba(70,84,62,.55), rgba(70,84,62,.28) 55%, rgba(70,84,62,0) 100%); }
.gc-desat { left: 2560px; width: 1241px; height: 720px; opacity: .95; -webkit-backdrop-filter: saturate(.22) brightness(.78) contrast(.9); backdrop-filter: saturate(.22) brightness(.78) contrast(.9);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 260px); mask-image: linear-gradient(90deg, transparent, #000 260px); transition: opacity 1s ease; }
.gc-objs, .gc-fxw { width: 0; height: 0; }
.gc-rays { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: .55; mix-blend-mode: screen;
  background-image: repeating-linear-gradient(104deg, rgba(255,255,255,0) 0 150px, rgba(200,240,255,.10) 175px 205px, rgba(255,255,255,0) 240px 420px);
  -webkit-mask-image: linear-gradient(180deg, #000 0, rgba(0,0,0,.6) 40%, transparent 75%); mask-image: linear-gradient(180deg, #000 0, rgba(0,0,0,.6) 40%, transparent 75%); }
.gc-dark { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; z-index: 3; pointer-events: none; }
.gc-snow { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: .5;
  background-image: radial-gradient(circle at 20px 30px, rgba(255,255,255,.8) 0 1.6px, transparent 2.4px), radial-gradient(circle at 160px 120px, rgba(255,255,255,.6) 0 1.2px, transparent 2px),
    radial-gradient(circle at 250px 210px, rgba(255,255,255,.7) 0 2px, transparent 2.8px), radial-gradient(circle at 90px 260px, rgba(255,255,255,.5) 0 1px, transparent 1.8px);
  background-size: 300px 300px; animation: gc-snow 14s linear infinite; }
@keyframes gc-snow { from { background-position-y: 0; } to { background-position-y: -300px; } }
.gc-weeds { position: absolute; left: 0; top: 330px; z-index: 5; pointer-events: none; will-change: transform; }
.gc-weeds svg { display: block; }
.gc-wd { animation: gc-sway 3.2s ease-in-out infinite alternate; }
@keyframes gc-sway { from { transform: skewX(-5deg); } to { transform: skewX(5deg); } }

/* ----- sinh vật ----- */
.gc-cr { position: absolute; left: 0; top: 0; will-change: transform; }
.gc-cr-in { position: absolute; }
.gc-cr-in > img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transition: opacity .55s ease; filter: drop-shadow(0 6px 6px rgba(0,30,60,.3)); }
.gc-cr .gc-happy { opacity: 0; }
.gc-cr.happy .gc-sad { opacity: 0; } .gc-cr.happy .gc-happy { opacity: 1; }
.gc-an-fish { animation: gc-fish 1.6s ease-in-out infinite; }
.gc-an-fish > img { animation: gc-tail .5s ease-in-out infinite alternate; transform-origin: 30% 50%; }
@keyframes gc-fish { 0%, 100% { transform: translate(0,0) rotate(0); } 50% { transform: translate(-6px,-7px) rotate(-3deg); } }
@keyframes gc-tail { from { transform: skewY(-3deg) scaleX(1); } to { transform: skewY(3deg) scaleX(.97); } }
.gc-an-turtle { animation: gc-turtle 2.2s ease-in-out infinite; }
.gc-an-turtle > img { animation: gc-paddle 1.1s ease-in-out infinite alternate; transform-origin: 50% 40%; }
@keyframes gc-turtle { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes gc-paddle { from { transform: rotate(-3deg) scaleY(1); } to { transform: rotate(3deg) scaleY(.96); } }
.gc-an-star { animation: gc-star 2.6s ease-in-out infinite; transform-origin: 50% 70%; }
@keyframes gc-star { 0%, 100% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(4deg) scale(1.04); } }
.gc-an-angler { animation: gc-fish 2.2s ease-in-out infinite; }
.gc-an-angler::after { content: ""; position: absolute; left: 1%; top: 3%; width: 16%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(120,230,255,.95), rgba(60,180,255,.45) 40%, rgba(60,180,255,0) 70%); mix-blend-mode: screen; animation: gc-lure 1.4s ease-in-out infinite alternate; }
@keyframes gc-lure { from { transform: scale(.8); opacity: .65; } to { transform: scale(1.45); opacity: 1; } }
.gc-cr.lit .gc-an-angler::after { animation-duration: .7s; }
.gc-cr.worried .gc-cr-in > img { animation: gc-worry 1.4s ease-in-out infinite; }
@keyframes gc-worry { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-2px) rotate(-1deg); } 40% { transform: translateX(2px) rotate(1deg); } 60% { transform: translateX(-1px); } }
.gc-cr.flinch .gc-cr-in { animation: gc-flinch .5s ease-out; }
@keyframes gc-flinch { 30% { transform: translateX(6px) rotate(3deg); } 60% { transform: translateX(-4px) rotate(-2deg); } }
.gc-cr.cheer .gc-cr-in { animation-duration: .9s; }
.gc-cr.cheer .gc-an-turtle > img { animation-duration: .35s; }
.gc-cr.swim .gc-an-fish > img { animation-duration: .25s; }
.gc-cr.gc-hidden .gc-cr-in > img { filter: brightness(.35) saturate(.6); }
.gc-ring, .gc-net { position: absolute; transform-origin: 50% 50%; }
.gc-strip { position: absolute; left: 0; top: 0; }
.gc-net .gc-strip { opacity: .95; }
.gc-fallw { position: absolute; width: 0; height: 0; }
.gc-fallw .gc-strip { position: absolute; }

/* ----- vật phẩm ----- */
.gc-it { position: absolute; left: 0; top: 0; will-change: transform; }
.gc-it > img { position: absolute; filter: drop-shadow(0 5px 5px rgba(0,30,60,.3)); }
.gc-trash > img { animation: gc-float 3s ease-in-out infinite; animation-delay: inherit; }
.gc-trash.held > img { animation: none; }
@keyframes gc-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-7px) rotate(4deg); } }
.gc-basket .gc-bfull { opacity: 0; transition: opacity .5s; }
.gc-basket.full .gc-bfull { opacity: 1; }
.gc-bcount { position: absolute; left: 22px; top: -62px; min-width: 40px; padding: 2px 8px; border-radius: 99px; background: #ff9b21; color: #fff; font-size: 15px; font-weight: 900; text-align: center; box-shadow: 0 2px 0 #c46a00; }
.gc-basket.bump > img { animation: gc-bump .45s ease-out; }
@keyframes gc-bump { 35% { transform: scale(1.12, .9); } 70% { transform: scale(.96, 1.05); } }
.gc-coral.glow > img { animation: gc-glow 2s ease-in-out infinite alternate; }
@keyframes gc-glow { from { filter: drop-shadow(0 0 4px rgba(255,170,200,.5)); } to { filter: drop-shadow(0 0 16px rgba(255,190,220,.95)); } }

/* ----- robot ----- */
.gc-robot { position: absolute; left: 0; top: 0; width: 1px; height: 1px; will-change: transform; z-index: 2; }
.gc-rb-in { position: absolute; left: 0; top: 0; }
.gc-pose { position: absolute; opacity: 0; filter: drop-shadow(0 8px 8px rgba(0,30,60,.3)); }
.gc-rb-in.gc-bob { animation: gc-rbob 2.2s ease-in-out infinite; }
@keyframes gc-rbob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(-1.5deg); } }
.gc-robot.gc-shake .gc-rb-in { animation: gc-rshake .9s ease-in-out; }
@keyframes gc-rshake { 15%, 45% { transform: rotate(-5deg); } 30%, 60% { transform: rotate(5deg); } 80% { transform: translateY(4px); } }
.gc-robot.gc-snip .gc-rb-in { animation: gc-rsnip .4s ease-out; }
@keyframes gc-rsnip { 40% { transform: translateX(6px) rotate(3deg); } }
.gc-robot.gc-jump .gc-rb-in { animation: gc-rjump .75s ease-in-out 2; }
@keyframes gc-rjump { 50% { transform: translateY(-22px) rotate(-3deg); } }
.gc-tool-grab { position: absolute; transform: scaleX(-1) scale(.6); transform-origin: 50% 50%; opacity: 0; transition: opacity .2s, transform .25s; }
.gc-tool-grab.on { opacity: 1; transform: scaleX(-1); }
.gc-beam { position: absolute; width: 320px; transform-origin: 0 50%; opacity: 0; mix-blend-mode: screen; transition: opacity .3s; pointer-events: none; }
.gc-beam.on { opacity: .85; }
.gc-robot[data-pose]:not([data-pose="scan"]) .gc-beam { opacity: 0; }
.gc-robot[data-pose]:not([data-pose="collect"]) .gc-tool-grab { opacity: 0; }

/* ----- hiệu ứng ----- */
.gc-fx { position: absolute; height: auto; pointer-events: none; animation: gc-pop .7s ease-out forwards; }
.gc-fx.gc-pop { animation-name: gc-pop; }
.gc-fx.gc-rise { animation-name: gc-rise; opacity: .8; }
.gc-fx.gc-rise2 { animation-name: gc-rise2; }
@keyframes gc-pop { 0% { transform: scale(.3); opacity: 0; } 25% { opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes gc-rise { 0% { transform: scale(var(--fx, 1), 1) translateY(0); opacity: 0; } 20% { opacity: .85; } 100% { transform: scale(var(--fx, 1), 1) translateY(-60px); opacity: 0; } }
@keyframes gc-rise2 { 0% { transform: translateY(20px) scale(.6); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(-50px) scale(1.1); opacity: 0; } }

/* ----- thanh thông tin (≈8%) ----- */
.gc-hud { position: absolute; left: 0; right: 0; top: 0; height: 58px; display: flex; align-items: center; gap: 8px; padding: 0 12px; z-index: 10;
  background: linear-gradient(180deg, rgba(3,52,92,.82), rgba(3,52,92,.45)); box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.gc-logo { height: 52px; width: auto; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.gc-pill { position: relative; height: 44px; flex: none; }
.gc-pill img { height: 44px; width: auto; display: block; }
.gc-pill b { position: absolute; left: 39%; right: 8%; top: 2px; bottom: 2px; display: flex; align-items: center; justify-content: center; color: #0e4a72; font-size: 21px; font-weight: 900; white-space: nowrap; }
.gc-p-time.warn b { color: #e2421b; animation: gc-warn .5s ease-in-out infinite alternate; }
@keyframes gc-warn { to { transform: scale(1.18); } }
.gc-pill.bump { animation: gc-pbump .45s ease-out; }
@keyframes gc-pbump { 40% { transform: scale(1.14); } }
.gc-team { color: #fff; font-weight: 800; font-size: 15px; padding: 5px 12px; border-radius: 99px; background: #ff8a1f; box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); white-space: nowrap; }
.gc-route { display: flex; align-items: center; margin-left: 10px; }
.gc-rz { position: relative; width: 36px; height: 36px; flex: none; transition: transform .3s; }
.gc-rz > img:first-child { width: 36px; height: 36px; display: block; }
.gc-rz.skip > img:first-child { filter: grayscale(.8) brightness(.8); opacity: .55; }
.gc-rz.lock > img:first-child { filter: brightness(.75); }
.gc-rz.part > img:first-child { filter: saturate(.6); }
.gc-rz.cur { transform: scale(1.22); z-index: 2; }
.gc-rring { position: absolute; left: -9px; top: -9px; width: 54px; height: 54px; animation: gc-spin 4s linear infinite; pointer-events: none; }
@keyframes gc-spin { to { transform: rotate(360deg); } }
.gc-rmark { position: absolute; right: -5px; bottom: -5px; width: 19px; height: auto; }
.gc-rl { width: 12px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.45); flex: none; }
.gc-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.gc-tool { border: 0; background: none; padding: 0; cursor: pointer; height: 46px; transition: transform .15s; }
.gc-tool img { height: 46px; width: auto; display: block; }
.gc-tool:hover { transform: translateY(-2px) scale(1.06); }
.gc-tool:active { transform: scale(.94); }
.gc-edit .gc-tool { pointer-events: none; }

/* ----- khung câu hỏi (9-slice, mẫu thấp / mẫu cao) ----- */
.gc-q { position: absolute; left: 24px; width: 1232px; top: 64px; z-index: 8; box-sizing: border-box; min-height: 104px; padding: 2px 16px 4px;
  border-style: solid; border-color: transparent; border-width: 36px 44px 19px; border-image: url("../games/giai-cuu-dai-duong/q-short.webp") 50 62 26 62 fill / 36px 44px 19px stretch;
  display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 4px 6px rgba(0,30,60,.3)); --qf: 30px;
  transform: translateY(-150%); opacity: 0; transition: transform .5s cubic-bezier(.2,1.2,.4,1), opacity .35s; }
.gc-q[data-tall="1"] { border-image-source: url("../games/giai-cuu-dai-duong/q-tall.webp"); border-image-slice: 50 62 30 62 fill; }
.gc-qa-on .gc-q { transform: none; opacity: 1; }
.gc-qt { width: 100%; margin-top: -14px; color: var(--gc-ink); font-size: var(--qf); line-height: 1.3; font-weight: 800; text-align: center; overflow-wrap: anywhere; }
.gc-q[data-lines="2"] .gc-qt, .gc-q[data-tall="1"] .gc-qt { text-align: left; }
.gc-qt .gc-img { max-height: 140px; max-width: 32%; float: right; margin: 0 0 4px 16px; border-radius: 10px; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.gc-ct .gc-img { max-height: calc(var(--ch) - 22px); vertical-align: middle; margin: 0 6px; border-radius: 6px; }
.gc-frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .82em; line-height: 1.1; margin: 0 .12em; }
.gc-frac > span:first-child { border-bottom: .09em solid currentColor; padding: 0 .15em; }
.gc-ov { border-top: .08em solid currentColor; padding-top: .05em; }
.gc-qt sup, .gc-ct sup, .gc-qt sub, .gc-ct sub { font-size: .66em; }

/* ----- thẻ đáp án 2×2 (9-slice giữ nguyên tỉ lệ huy hiệu chữ cái) ----- */
.gc-cards { position: absolute; left: 24px; width: 1232px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; row-gap: 12px; z-index: 8; --cf: 26px; --ch: 88px;
  transform: translateY(130%); opacity: 0; transition: transform .5s cubic-bezier(.2,1.1,.4,1), opacity .35s; }
.gc-qa-on .gc-cards { transform: none; opacity: 1; }
.gc-card { --ci: url("../games/giai-cuu-dai-duong/card-a.webp"); position: relative; isolation: isolate; box-sizing: border-box; height: var(--ch); margin: 0; border: 0; background: none;
  display: flex; align-items: center; padding: 7px calc(var(--ch) * .34) 7px calc(var(--ch) * 1.04); cursor: pointer; font: inherit; color: #12355e; text-align: left;
  transition: transform .15s ease, filter .2s ease; filter: drop-shadow(0 4px 5px rgba(0,30,60,.28)); }
.gc-card::before { content: ""; position: absolute; inset: 0; z-index: -1; box-sizing: border-box; border-style: solid; border-color: transparent;
  border-width: calc(var(--ch) / 2) calc(var(--ch) * .305) calc(var(--ch) / 2) calc(var(--ch) * 1.006);
  border-image: var(--ci) 50% 7% 50% 23% fill / calc(var(--ch) / 2) calc(var(--ch) * .305) calc(var(--ch) / 2) calc(var(--ch) * 1.006) stretch; }
.gc-c-b { --ci: url("../games/giai-cuu-dai-duong/card-b.webp"); } .gc-c-c { --ci: url("../games/giai-cuu-dai-duong/card-c.webp"); } .gc-c-d { --ci: url("../games/giai-cuu-dai-duong/card-d.webp"); }
.gc-c-a.sel, .gc-c-a.right { --ci: url("../games/giai-cuu-dai-duong/card-a-hi.webp"); } .gc-c-b.sel, .gc-c-b.right { --ci: url("../games/giai-cuu-dai-duong/card-b-hi.webp"); }
.gc-c-c.sel, .gc-c-c.right { --ci: url("../games/giai-cuu-dai-duong/card-c-hi.webp"); } .gc-c-d.sel, .gc-c-d.right { --ci: url("../games/giai-cuu-dai-duong/card-d-hi.webp"); }
.gc-c-a.wrong { --ci: url("../games/giai-cuu-dai-duong/card-a-no.webp"); } .gc-c-b.wrong { --ci: url("../games/giai-cuu-dai-duong/card-b-no.webp"); }
.gc-c-c.wrong { --ci: url("../games/giai-cuu-dai-duong/card-c-no.webp"); } .gc-c-d.wrong { --ci: url("../games/giai-cuu-dai-duong/card-d-no.webp"); }
.gc-ct { flex: 1; min-width: 0; max-height: calc(var(--ch) - 14px); overflow: hidden; font-size: var(--cf); line-height: 1.22; font-weight: 800; text-align: center; overflow-wrap: anywhere; }
.gc-card.gc-long .gc-ct { text-align: left; }
.gc-ok { position: absolute; right: calc(var(--ch) * .14); top: 50%; height: calc(var(--ch) * .6); width: auto; transform: translateY(-50%) scale(.2); opacity: 0; transition: transform .35s cubic-bezier(.2,1.6,.4,1), opacity .2s; }
.gc-card.right { padding-right: calc(var(--ch) * .82); filter: drop-shadow(0 0 7px rgba(40,220,110,.95)) drop-shadow(0 0 3px rgba(40,220,110,.9)); animation: gc-right .6s ease-out; }
.gc-card.right .gc-ok { opacity: 1; transform: translateY(-50%) scale(1); }
.gc-card.wrong { animation: gc-wrong .45s ease-in-out; filter: drop-shadow(0 0 6px rgba(240,60,40,.7)); }
.gc-card.dim { filter: drop-shadow(0 3px 4px rgba(0,30,60,.2)) saturate(.5) brightness(.95); opacity: .82; }
.gc-card:hover:not(.dim) { transform: translateY(-3px); }
.gc-card:focus-visible { outline: 4px solid #fff; outline-offset: 2px; border-radius: 99px; }
.gc-cards.gc-lock .gc-card { cursor: default; pointer-events: none; }
.gc-card.key::after { content: "Đáp án đúng"; position: absolute; right: 26px; top: -9px; z-index: 2; line-height: 18px; background: #16a34a; color: #fff; font-size: 13px; font-weight: 800; padding: 2px 10px; border-radius: 99px; }
@keyframes gc-right { 30% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes gc-wrong { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* ----- nhiệm vụ, biểu ngữ vùng, thông báo ----- */
.gc-mission { position: absolute; left: 18px; z-index: 9; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 4px; border-radius: 26px;
  background: rgba(4,46,86,.72); color: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.22); opacity: 0; transition: opacity .4s; }
.gc-qa-on .gc-mission, .gc-edit .gc-mission { opacity: 1; }
.gc-mission > img { width: 40px; height: 40px; }
.gc-mission b { display: block; font-size: 16px; font-weight: 800; line-height: 1.1; }
.gc-dots { display: flex; gap: 4px; margin-top: 3px; }
.gc-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.3); }
.gc-dots i.on { background: #4ee08a; box-shadow: 0 0 6px #4ee08a; }
.gc-dots i.miss { background: #ff9d5c; }
.gc-banner { position: absolute; left: 50%; top: 230px; z-index: 12; display: flex; align-items: center; gap: 16px; padding: 12px 34px 12px 14px; border-radius: 80px; transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255,250,232,.97), rgba(255,240,200,.97)); border: 4px solid #3cc2d8; box-shadow: 0 8px 24px rgba(0,30,60,.35); color: var(--gc-navy); }
.gc-banner .gc-bz { width: 104px; height: 104px; }
.gc-banner small { display: block; font-size: 16px; font-weight: 800; color: #0f8aa8; letter-spacing: .5px; text-transform: uppercase; }
.gc-banner b { display: block; font-size: 38px; font-weight: 900; line-height: 1.1; }
.gc-banner span { display: block; font-size: 18px; font-weight: 700; margin-top: 4px; color: #2c5a7a; }
.gc-banner.in { animation: gc-bin .55s cubic-bezier(.2,1.4,.4,1); }
.gc-banner.out { animation: gc-bout .4s ease-in forwards; }
@keyframes gc-bin { from { transform: translateX(-50%) scale(.5); opacity: 0; } }
@keyframes gc-bout { to { transform: translateX(-50%) translateY(-30px) scale(.85); opacity: 0; } }
.gc-msg { position: absolute; left: 50%; top: 200px; z-index: 12; transform: translateX(-50%); padding: 9px 28px; border-radius: 99px; font-size: 22px; font-weight: 800; color: #fff; white-space: nowrap; pointer-events: none;
  background: linear-gradient(180deg, #3fd57a, #17a64c); box-shadow: 0 4px 0 #0e7a36, 0 8px 18px rgba(0,0,0,.25); max-width: 1180px; overflow: hidden; text-overflow: ellipsis; }
.gc-msg b { color: #fff6a0; margin-left: 4px; }
.gc-msg.gc-m-no { background: linear-gradient(180deg, #ffb04a, #f07d1a); box-shadow: 0 4px 0 #b55a07, 0 8px 18px rgba(0,0,0,.25); }
.gc-msg.in { animation: gc-msgin .4s ease-out; }
@keyframes gc-msgin { from { transform: translateX(-50%) scale(.6); opacity: 0; } }
.gc-next { position: absolute; right: 24px; top: 200px; z-index: 12; border: 0; cursor: pointer; padding: 12px 26px; border-radius: 99px; font: inherit; font-size: 22px; font-weight: 900; color: #fff;
  background: linear-gradient(180deg, #2fb4f0, #0b78c9); box-shadow: 0 4px 0 #075a98, 0 8px 18px rgba(0,0,0,.25); }
.gc-note { position: absolute; left: 50%; top: 80px; transform: translateX(-50%); z-index: 40; background: rgba(4,30,60,.88); color: #fff; padding: 10px 20px; border-radius: 12px; font-size: 18px; font-weight: 700; }
.gc-pause { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(2,24,52,.6); backdrop-filter: blur(3px); }
.gc-pbox { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #fff; text-align: center; }
.gc-pbox b { font-size: 56px; font-weight: 900; text-shadow: 0 4px 0 #0b2f5c; }
.gc-pbox span { font-size: 20px; opacity: .9; }
.gc-resume { margin-top: 12px; border: 0; cursor: pointer; padding: 14px 34px; border-radius: 99px; background: #ffd23f; color: #6b3a00; font: inherit; font-size: 24px; font-weight: 900; box-shadow: 0 5px 0 #c99400; }

/* ----- màn mở đầu ----- */
.gc-intro { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 45%, rgba(4,40,90,.25), rgba(2,20,60,.7)); transition: opacity .5s; }
.gc-intro.out { opacity: 0; pointer-events: none; }
.gc-ibox { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: #fff; }
.gc-ilogo { width: 430px; height: auto; filter: drop-shadow(0 8px 14px rgba(0,0,0,.35)); animation: gc-logo 3s ease-in-out infinite; }
@keyframes gc-logo { 50% { transform: translateY(-8px) rotate(-1deg); } }
.gc-ibox p { margin: 0; font-size: 21px; font-weight: 700; max-width: 760px; text-shadow: 0 2px 4px rgba(0,0,0,.45); }
.gc-iroute { display: flex; gap: 14px; margin: 6px 0 4px; }
.gc-iroute > div { width: 132px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 16px; background: rgba(255,255,255,.14); }
.gc-iroute img { width: 74px; height: 74px; }
.gc-iroute b { font-size: 15px; line-height: 1.15; }
.gc-iroute small { font-size: 13px; opacity: .85; }
.gc-iroute .skip { opacity: .5; }
.gc-start { border: 0; cursor: pointer; padding: 14px 40px; border-radius: 99px; font: inherit; font-size: 27px; font-weight: 900; color: #6b3a00;
  background: linear-gradient(180deg, #ffe062, #ffb81c); box-shadow: 0 6px 0 #c98700, 0 12px 22px rgba(0,0,0,.3); animation: gc-pulse 1.6s ease-in-out infinite; }
.gc-start:hover { filter: brightness(1.06); }
@keyframes gc-pulse { 50% { transform: scale(1.05); } }
.gc-ihint { font-size: 15px; opacity: .85; }

/* ----- màn tổng kết ----- */
.gc-sbg { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; }
.gc-stitle { position: absolute; left: 212px; top: 62px; width: 348px; height: 62px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 27px; font-weight: 900; text-shadow: 0 3px 0 #0b3f8a; }
.gc-sbox { position: absolute; left: 92px; top: 138px; width: 574px; height: 478px; display: flex; flex-direction: column; gap: 8px; color: var(--gc-navy); animation: gc-srise .6s ease-out both; }
@keyframes gc-srise { from { transform: translateY(30px); opacity: 0; } }
.gc-shead { text-align: center; }
.gc-stars { display: flex; justify-content: center; gap: 6px; line-height: 1; }
.gc-stars span { font-size: 40px; color: #cbd5e1; text-shadow: 0 2px 0 rgba(0,0,0,.12); }
.gc-stars span:nth-child(2) { font-size: 50px; }
.gc-stars span.on { color: #ffc61a; text-shadow: 0 0 10px rgba(255,200,40,.8), 0 2px 0 #c98a00; animation: gc-star-in .6s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes gc-star-in { from { transform: scale(0) rotate(-90deg); } }
.gc-shead b { display: block; font-size: 24px; font-weight: 900; color: #0d5a8a; line-height: 1.2; margin-top: 2px; }
.gc-shead small { display: block; font-size: 14.5px; font-weight: 600; color: #4a6a84; }
.gc-total { display: flex; align-items: center; gap: 12px; padding: 4px 14px; border-radius: 16px; background: rgba(60,194,216,.14); border: 2px solid rgba(60,194,216,.4); }
.gc-total .gc-tp { height: 48px; width: 48px; object-fit: cover; object-position: 0 50%; }
.gc-total small { display: block; font-size: 14px; font-weight: 700; color: #4a6a84; }
.gc-total b { font-size: 38px; font-weight: 900; line-height: 1; color: #e07b00; }
.gc-rate { margin-left: auto; text-align: right; }
.gc-rate b { color: #16964a; font-size: 32px; }
.gc-slist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 16px; }
.gc-slist li { display: flex; align-items: center; gap: 8px; font-size: 15.5px; font-weight: 700; border-bottom: 2px dotted rgba(11,47,92,.16); padding: 2px; }
.gc-slist li span { flex: 1; }
.gc-slist li b { font-size: 19px; font-weight: 900; }
.gc-slist li b.ok { color: #16964a; } .gc-slist li b.no { color: #d0451b; }
.gc-slist li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.gc-si { width: 28px; height: 28px; object-fit: contain; flex: none; display: inline-block; }
.gc-si[src*="pill-"] { object-fit: cover; object-position: 0 50%; }
.gc-ricons { display: flex; justify-content: center; gap: 4px; }
.gc-ricon { height: 38px; width: auto; animation: gc-fish 1.8s ease-in-out infinite; }
.gc-sbox.teams .gc-slist li { font-size: 14px; padding: 1px 2px; }
.gc-sbox.teams .gc-shead small, .gc-sbox.teams .gc-ricons { display: none; }
.gc-board { padding: 4px 12px; border-radius: 14px; background: rgba(255,198,26,.14); border: 2px solid rgba(255,180,20,.45); }
.gc-board > b { font-size: 15px; font-weight: 900; color: #b56a00; }
.gc-board ol { list-style: none; margin: 2px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
.gc-board li { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; }
.gc-board li span:nth-child(2) { flex: 1; }
.gc-medal { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px; background: #94a3b8; }
.gc-board .r1 .gc-medal { background: linear-gradient(#ffd54a, #e6a100); } .gc-board .r2 .gc-medal { background: linear-gradient(#e2e8f0, #9aa7b8); } .gc-board .r3 .gc-medal { background: linear-gradient(#f0a96a, #b8661f); }
.gc-sbtn { display: flex; justify-content: center; gap: 10px; margin-top: auto; }
.gc-wbtn { border: 0; cursor: pointer; height: 48px; padding: 0 20px; border-radius: 99px; font: inherit; font-size: 18px; font-weight: 900; color: #fff;
  background: linear-gradient(180deg, #3fd57a, #17a64c); box-shadow: 0 4px 0 #0e7a36, 0 8px 14px rgba(0,0,0,.2); transition: transform .15s; white-space: nowrap; }
.gc-wbtn.gc-wb2 { background: linear-gradient(180deg, #2fb4f0, #0b78c9); box-shadow: 0 4px 0 #075a98, 0 8px 14px rgba(0,0,0,.2); }
.gc-wbtn.gc-wb3 { background: linear-gradient(180deg, #ff9d5c, #ea6a1f); box-shadow: 0 4px 0 #b4480c, 0 8px 14px rgba(0,0,0,.2); }
.gc-wbtn:hover { transform: translateY(-2px); }
.gc-detail { position: absolute; inset: 0; z-index: 5; background: rgba(2,24,52,.55); }
.gc-dbox { position: absolute; left: 70px; top: 50px; width: 640px; height: 620px; display: flex; flex-direction: column; padding: 16px 20px; box-sizing: border-box; border-radius: 22px; background: #fff8e6; border: 5px solid #3cc2d8; box-shadow: 0 10px 30px rgba(0,0,0,.35); color: var(--gc-navy); }
.gc-dbox h3 { margin: 0 0 8px; font-size: 24px; font-weight: 900; }
.gc-dbox ol { flex: 1; overflow: auto; margin: 0; padding: 0 6px 0 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.gc-dbox li { position: relative; padding: 8px 90px 8px 12px; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); font-size: 15px; }
.gc-dq small { display: block; color: #0f8aa8; font-weight: 800; font-size: 12.5px; }
.gc-dq { font-weight: 700; }
.gc-da { margin-top: 3px; color: #36536c; }
.gc-da span { display: block; color: #c2410c; }
.gc-da em { display: block; color: #64748b; font-size: 13.5px; }
.gc-dr { position: absolute; right: 10px; top: 10px; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 800; background: #e2e8f0; color: #475569; }
.gc-dr.ok { background: #dcfce7; color: #15803d; } .gc-dr.no { background: #ffe4d6; color: #c2410c; } .gc-dr.to { background: #fef3c7; color: #a16207; }
.gc-dact { display: flex; justify-content: flex-end; margin-top: 10px; }
.gc-sfx { position: absolute; inset: 0; pointer-events: none; }
/* thiết lập điểm dừng robot (trang soạn) */
.gc-stops { flex-wrap: wrap; }
.gc-stopg { display: flex; gap: 6px; }
.gc-stop { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gc-stop small { font-size: 11.5px; color: #64748b; }
.gc-stop .ge-sel { min-width: 0; width: 66px; padding-left: 6px; padding-right: 4px; }

/* nút thêm hình ảnh minh hoạ (mẫu hỗ trợ ảnh) */
.ge-imgbtn { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; border: 1px solid var(--line, #d6dee8); background: #fff; border-radius: 8px; padding: 3px 9px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-strong, #1f2d3d); cursor: pointer; }
.ge-imgbtn .icon { width: 15px; height: 15px; }
.ge-imgbtn:hover { border-color: var(--primary, #2f6fed); color: var(--primary, #2f6fed); }
