/* ============================================================
   Giao dien: khoi vuong + vien cung + bong cung (Minecraft),
   mau tuoi + nut bam day (Duolingo). Uu tien man hinh cham.
   ============================================================ */

:root {
  --nen:        #0f1720;
  --nen-2:      #17222e;
  --the:        #1e2b3a;
  --the-sang:   #26364a;
  --vien:       #0a1119;
  --chu:        #eaf2f8;
  --chu-mo:     #9fb3c6;
  --xanh:       #58cc02;   /* xanh Duolingo */
  --xanh-dam:   #46a302;
  --lam:        #1cb0f6;
  --lam-dam:    #1a94d0;
  --cam:        #ff9600;
  --do:         #ff4b4b;
  --vang:       #ffc800;
  --tim:        #ce82ff;
  --bo-goc:     14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--nen);
  color: var(--chu);
  font-family: 'Baloo 2', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 17px;
  overscroll-behavior-y: none;
}

body { padding-bottom: 88px; }
body.che-do-mam { font-size: 21px; }

img, canvas { image-rendering: pixelated; }

/* ---------------- khung ---------------- */
.man { max-width: 900px; margin: 0 auto; padding: 14px 14px 20px; }
.hang { display: flex; align-items: center; gap: 10px; }
.hang-giua { display: flex; align-items: center; justify-content: center; gap: 10px; }
.doc { display: flex; flex-direction: column; gap: 12px; }
.gian { flex: 1; }

.the {
  background: var(--the);
  border: 3px solid var(--vien);
  border-radius: var(--bo-goc);
  box-shadow: 0 4px 0 var(--vien);
  padding: 14px;
}
.the-nhat { background: var(--nen-2); }

h1, h2, h3 { margin: 0 0 8px; font-weight: 800; letter-spacing: .2px; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
.mo { color: var(--chu-mo); font-size: .92em; }

/* ---------------- nut ---------------- */
.nut {
  font: inherit; font-weight: 800;
  border: none; border-radius: 12px;
  padding: 12px 18px;
  background: var(--the-sang); color: var(--chu);
  box-shadow: 0 4px 0 rgba(0,0,0,.45);
  cursor: pointer; transition: transform .06s, box-shadow .06s;
  touch-action: manipulation;
}
.nut:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.45); }
.nut-chinh { background: var(--xanh); color: #06210a; box-shadow: 0 4px 0 var(--xanh-dam); }
.nut-lam   { background: var(--lam); color: #04202e; box-shadow: 0 4px 0 var(--lam-dam); }
.nut-do    { background: var(--do); color: #2b0505; box-shadow: 0 4px 0 #cc2f2f; }
.nut-nhat  { background: transparent; color: var(--chu-mo); box-shadow: none; border: 2px solid #33455a; }
.nut:disabled { opacity: .45; cursor: not-allowed; }
.nut-to { padding: 16px 22px; font-size: 1.1em; width: 100%; }

/* ---------------- man chon nguoi ---------------- */
.luoi-nguoi { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.luoi-nguoi > * { width: 140px; }
.the-nguoi {
  background: var(--the); border: 3px solid var(--vien); border-radius: var(--bo-goc);
  padding: 16px 10px; text-align: center; cursor: pointer;
  box-shadow: 0 5px 0 var(--vien); transition: transform .08s;
}
.the-nguoi:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--vien); }
.the-nguoi .mat { font-size: 3rem; line-height: 1.1; }
.the-nguoi .ten { font-weight: 800; margin-top: 6px; }
.the-nguoi .vai { font-size: .78em; color: var(--chu-mo); }

/* ---------------- thanh dieu huong ---------------- */
.thanh-duoi {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center; gap: 4px;
  background: var(--nen-2); border-top: 3px solid var(--vien);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.thanh-duoi button {
  /* 6 tab - phai vua ca man hinh dien thoai hep nhat */
  flex: 1; min-width: 0; max-width: 110px; background: none; border: none; color: var(--chu-mo);
  font: inherit; font-weight: 700; font-size: .72rem; padding: 6px 1px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 10px;
}
.thanh-duoi button .bt { font-size: 1.4rem; line-height: 1; }
@media (max-width: 380px) {
  .thanh-duoi button { font-size: .62rem; }
  .thanh-duoi button .bt { font-size: 1.25rem; }
}
.thanh-duoi button.dang { color: var(--xanh); background: rgba(88,204,2,.12); }
.thanh-duoi button .cham {
  position: absolute; transform: translate(16px, -4px);
  background: var(--do); color: #fff; border-radius: 999px;
  font-size: .68rem; padding: 1px 6px; font-weight: 800;
}

/* ---------------- dau trang: chuoi, XP, cap ---------------- */
.bang-chi-so { display: flex; gap: 8px; flex-wrap: wrap; }
.chi-so {
  display: flex; align-items: center; gap: 6px;
  background: var(--nen-2); border: 2px solid var(--vien); border-radius: 999px;
  padding: 6px 12px; font-weight: 800;
}
.chi-so.lua { color: var(--cam); }
.chi-so.lua.tat { color: #6b7a89; }
.chi-so.xp { color: var(--vang); }
.chi-so.bang-da { color: #7fd6ff; }

.thanh-tien { height: 16px; background: var(--nen); border: 2px solid var(--vien); border-radius: 999px; overflow: hidden; }
.thanh-tien > i { display: block; height: 100%; background: linear-gradient(90deg, var(--xanh), #8ef04a); transition: width .5s; }
.thanh-tien.vang > i { background: linear-gradient(90deg, var(--vang), #ffe066); }

/* ---------------- linh vat ---------------- */
.linh-vat { display: flex; gap: 12px; align-items: flex-start; }
.be-vuong {
  width: 64px; height: 64px; flex: none; border-radius: 8px;
  border: 3px solid var(--vien); position: relative;
  animation: nhun 2.6s ease-in-out infinite;
}
.be-vuong::before, .be-vuong::after {
  content: ''; position: absolute; top: 20px; width: 10px; height: 12px;
  background: #10202c; border-radius: 2px;
}
.be-vuong::before { left: 10px; }
.be-vuong::after  { right: 10px; }
.be-vuong i {
  position: absolute; left: 18px; right: 18px; top: 42px; height: 6px;
  background: #10202c; border-radius: 0 0 6px 6px;
}
@keyframes nhun { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-5px) } }
.bong-noi {
  background: var(--the-sang); border: 3px solid var(--vien); border-radius: 12px;
  padding: 10px 14px; position: relative; flex: 1; font-weight: 600;
}
.bong-noi::before {
  content: ''; position: absolute; left: -12px; top: 20px;
  border: 6px solid transparent; border-right-color: var(--vien);
}

/* ---------------- the nhiem vu ---------------- */
.viec {
  display: flex; align-items: center; gap: 12px;
  background: var(--the); border: 3px solid var(--vien); border-radius: var(--bo-goc);
  padding: 12px; box-shadow: 0 4px 0 var(--vien);
}
.viec.xong { opacity: .5; }
.viec .bt { font-size: 2rem; flex: none; width: 46px; text-align: center; }
.viec .ten { font-weight: 800; }
.viec .duoi { font-size: .82em; color: var(--chu-mo); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.the-tag {
  background: var(--nen); border: 2px solid var(--vien); border-radius: 999px;
  padding: 1px 8px; font-size: .78em; font-weight: 700;
}
.the-tag.cho { color: var(--cam); border-color: var(--cam); }

body.che-do-mam .viec { padding: 18px; }
body.che-do-mam .viec .bt { font-size: 3rem; width: 62px; }
body.che-do-mam .viec .duoi { display: none; }
body.che-do-mam .viec .nut { padding: 16px 20px; }

/* ---------------- khoi & the gioi ---------------- */
.khoi {
  width: 32px; height: 32px; background-size: cover;
  border-radius: 3px; flex: none;
}
.khoi.to { width: 44px; height: 44px; }
.khoi.nho { width: 24px; height: 24px; }

.kho-khoi { display: flex; flex-wrap: wrap; gap: 8px; }
.o-kho { position: relative; }
.o-kho .so {
  position: absolute; right: -3px; bottom: -4px;
  background: var(--nen); border: 2px solid var(--vien); border-radius: 6px;
  font-size: .7rem; font-weight: 800; padding: 0 4px;
}
.o-kho.chon .khoi { outline: 3px solid var(--vang); outline-offset: 2px; }

.luoi-the-gioi {
  display: grid; gap: 1px; background: var(--vien);
  border: 3px solid var(--vien); border-radius: 8px; overflow: hidden;
  touch-action: manipulation; user-select: none;
}
.luoi-the-gioi .o {
  aspect-ratio: 1; background: #14202c; background-size: cover; position: relative;
}
.luoi-the-gioi .o.trong:active { background: #1d2e3e; }

/* ---------------- hanh trinh gia dinh ---------------- */
.tieu-de-hanh-trinh { display: flex; align-items: center; gap: 12px; }
.tieu-de-hanh-trinh h2, .tieu-de-hanh-trinh p { margin-bottom: 0; }
.huy-hieu-tien-do {
  margin-left: auto; flex: none; color: var(--vang); font-weight: 800;
  background: var(--nen-2); border: 2px solid var(--vien); border-radius: 999px; padding: 6px 12px;
}
.duong-hanh-trinh { position: relative; margin: 14px 0 0 22px; padding-left: 28px; }
.duong-hanh-trinh::before {
  content: ''; position: absolute; left: 0; top: 28px; bottom: 28px; width: 6px;
  background: repeating-linear-gradient(to bottom, var(--xanh) 0 12px, #33455a 12px 24px);
  border: 2px solid var(--vien); border-radius: 999px;
}
.chuong-hanh-trinh { position: relative; margin-bottom: 16px; }
.chuong-hanh-trinh::before {
  content: ''; position: absolute; left: -39px; top: 27px; width: 24px; height: 6px;
  background: var(--the-sang); border: 2px solid var(--vien);
}
.chuong-hanh-trinh.dang_mo { border-color: var(--xanh); box-shadow: 0 5px 0 var(--xanh-dam); }
.chuong-hanh-trinh.khoa { opacity: .62; filter: saturate(.45); }
.chuong-hanh-trinh.xong { background: linear-gradient(135deg, var(--the), rgba(88,204,2,.12)); }
.so-chuong {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  background: var(--nen); border: 2px solid var(--vien); border-radius: 50%; font-weight: 800;
}
.dang_mo .so-chuong { background: var(--xanh); color: #06210a; }
.xong .so-chuong { background: var(--xanh-dam); color: white; }
.nhan-chuong { color: var(--xanh); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.thong-bao-khoa { margin-top: 10px; color: var(--chu-mo); font-size: .86em; text-align: center; }

/* ---------------- cua hang thuong ---------------- */
.the-thuong { display: flex; align-items: center; gap: 12px; }
.the-thuong .gia { font-weight: 800; color: var(--vang); white-space: nowrap; }
.the-thuong.khoa { opacity: .55; }

/* ---------------- bang xep hang ---------------- */
.hang-bxh { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.hang-bxh .thu { width: 32px; font-weight: 800; text-align: center; font-size: 1.1em; }
.hang-bxh .mat { font-size: 1.8rem; }

/* ---------------- dong thoi gian ---------------- */
.dong-tg { border-left: 3px solid var(--the-sang); margin-left: 14px; padding-left: 14px; }
.dong-tg .muc { position: relative; padding: 8px 0; }
.dong-tg .muc::before {
  content: ''; position: absolute; left: -21px; top: 16px;
  width: 10px; height: 10px; background: var(--xanh); border: 2px solid var(--vien); border-radius: 3px;
}

/* ---------------- form ---------------- */
input, select, textarea {
  font: inherit; width: 100%;
  background: var(--nen); color: var(--chu);
  border: 3px solid var(--vien); border-radius: 10px; padding: 10px 12px;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--lam); border-color: var(--lam); }
/* O bi khoa (vd XP khi nhiem vu da co moc) - phai nhin ra ngay la khong dung nua */
input:disabled, select:disabled, textarea:disabled {
  opacity: .4; background: #0d151d; cursor: not-allowed;
}
label { display: block; font-weight: 700; font-size: .88em; margin: 10px 0 4px; color: var(--chu-mo); }
.o-pin { letter-spacing: .5em; text-align: center; font-size: 1.6rem; }

.luoi-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------------- thong bao & hop thoai ---------------- */
.khay-bao { position: fixed; left: 0; right: 0; top: 12px; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.bao {
  background: var(--the-sang); border: 3px solid var(--vien); border-radius: 12px;
  padding: 10px 16px; font-weight: 700; box-shadow: 0 5px 0 var(--vien);
  animation: roi .25s ease; max-width: 90vw;
}
.bao-loi { background: var(--do); color: #fff; }
.bao-mung { background: var(--vang); color: #2b1d00; }
.bao-di { opacity: 0; transform: translateY(-12px); transition: .5s; }
@keyframes roi { from { transform: translateY(-20px); opacity: 0 } }

.nen-mo {
  position: fixed; inset: 0; z-index: 80; background: rgba(4,10,16,.72);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.hop-thoai {
  background: var(--the); border: 3px solid var(--vien); border-radius: var(--bo-goc);
  padding: 18px; width: 100%; max-width: 460px; max-height: 86vh; overflow: auto;
  box-shadow: 0 8px 0 var(--vien);
}
.hang-nut { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }

/* ---------------- phao hoa ---------------- */
.phao { position: fixed; inset: 0; pointer-events: none; z-index: 120; }
.phao .hat {
  position: absolute; bottom: 30%; width: 10px; height: 10px; border-radius: 2px;
  animation: bay 1.4s ease-out forwards;
}
@keyframes bay {
  to { transform: translate(var(--dx), var(--dy)) rotate(540deg); opacity: 0 }
}

/* ---------------- tien ich ---------------- */
.can-giua { text-align: center; }
.cach-tren { margin-top: 16px; }
.an { display: none !important; }
.cuon-ngang { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 420px) {
  .man { padding: 10px 10px 16px; }
  .luoi-2 { grid-template-columns: 1fr; }
}

/* ============================================================
   Vat pham & nhan vat
   ============================================================ */

.khung-nv {
  display: flex; align-items: flex-end; gap: 6px;
  background: linear-gradient(#1a2836, #0f1a24);
  border: 3px solid var(--vien); border-radius: 10px;
  padding: 8px 10px; flex: none;
}
.khung-nv.nho { padding: 4px 6px; cursor: pointer; }
.nhan-vat { display: flex; align-items: flex-end; gap: 4px; }
.nhan-vat canvas { display: block; }
.thu-nuoi { line-height: 1; filter: drop-shadow(0 2px 0 rgba(0,0,0,.5)); }

/* Cac o tren nguoi */
.luoi-o { display: flex; flex-wrap: wrap; gap: 8px; }
.o-trang-bi {
  width: 70px; background: var(--nen); border: 3px solid #33455a; border-radius: 10px;
  padding: 6px 4px; text-align: center; position: relative;
}
.o-trang-bi.co { cursor: pointer; background: var(--the-sang); }
.o-trang-bi .nhan-o { font-size: .64rem; color: var(--chu-mo); font-weight: 700; }
.o-trang-bi .bt-o { font-size: 1.7rem; line-height: 1.2; }
.o-trang-bi .sm-o { font-size: .64rem; color: var(--cam); font-weight: 800; }

/* The mot vat pham (ban che tao / tui do) */
.the.vat-pham { border-width: 3px; margin-top: 10px; }
.the.vat-pham .bt-vp { font-size: 2rem; width: 46px; text-align: center; flex: none; }

body.che-do-mam .o-trang-bi { width: 84px; }
body.che-do-mam .o-trang-bi .bt-o { font-size: 2.2rem; }

/* ============================================================
   GAME UI 2.0 — lop trinh bay, khong thay doi logic tro choi
   ============================================================ */
:root {
  --nen: #071019;
  --nen-2: #101d29;
  --the: #172838;
  --the-sang: #20384c;
  --vien: #050a0f;
  --vien-sang: #39566f;
  --bong-game: 0 6px 0 #050a0f, 0 10px 24px rgba(0,0,0,.28);
}

html { background: #071019; }
body {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(28,176,246,.13), transparent 25rem),
    radial-gradient(circle at 82% 22%, rgba(88,204,2,.10), transparent 22rem),
    linear-gradient(180deg, #0c1d2a 0, #071019 58%, #050b11 100%);
  background-attachment: fixed;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}
body::after {
  content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: 25vh; z-index: -1;
  background:
    linear-gradient(135deg, transparent 75%, rgba(88,204,2,.06) 75%) 0 0/48px 48px,
    linear-gradient(225deg, transparent 75%, rgba(28,176,246,.05) 75%) 0 0/48px 48px;
}

.man {
  max-width: 940px;
  padding: 22px 18px 34px;
  animation: vao-man .22s ease-out;
}
@keyframes vao-man {
  from { opacity: 0; transform: translateY(7px); }
}

h1 {
  font-size: clamp(1.55rem, 4vw, 2rem);
  line-height: 1.05;
  text-shadow: 0 3px 0 rgba(0,0,0,.45);
}
h2 { color: #f4f8fb; }
.tieu-de-khu {
  display: flex; align-items: center; min-height: 42px;
  border-bottom: 3px solid rgba(57,86,111,.55);
  padding: 0 4px 8px;
}
.nhan-nho, .nhan-chuong {
  color: var(--xanh); font-size: .72rem; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase;
}

.the, .viec {
  border-color: var(--vien);
  border-top-color: var(--vien-sang);
  box-shadow: var(--bong-game);
  background:
    linear-gradient(135deg, rgba(255,255,255,.035), transparent 45%),
    var(--the);
}
.the { padding: 16px; }
.the-nhat {
  background:
    linear-gradient(135deg, rgba(28,176,246,.05), transparent 45%),
    var(--nen-2);
}
.the:hover, .viec:hover { border-top-color: #4b6d88; }

.nut {
  position: relative;
  border: 2px solid rgba(255,255,255,.08);
  border-bottom-color: rgba(0,0,0,.45);
  border-radius: 10px;
  letter-spacing: .01em;
  text-shadow: 0 1px 0 rgba(255,255,255,.16);
  transition: transform .08s, filter .12s, box-shadow .08s;
}
.nut:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
.nut:active:not(:disabled) { transform: translateY(3px); filter: brightness(.95); }
.nut-chinh { background: linear-gradient(#70dc19, #50b908); }
.nut-lam { background: linear-gradient(#42c5ff, #159ddb); }
.nut-do { background: linear-gradient(#ff6868, #e43f3f); }
.nut-nhat { background: rgba(16,29,41,.78); border-color: #395066; }

/* HUD nguoi choi */
.dau-nguoi-choi {
  padding: 12px 14px;
  border: 3px solid var(--vien);
  border-top-color: var(--vien-sang);
  border-radius: 14px;
  background: linear-gradient(100deg, #172c3d, #10202e);
  box-shadow: var(--bong-game);
}
.bang-chi-so { gap: 9px; }
.chi-so {
  min-height: 39px;
  border-radius: 9px;
  border-color: #071019;
  background: linear-gradient(180deg, #172838, #0c1721);
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 3px 0 #050a0f;
}
.thanh-tien {
  height: 18px;
  padding: 2px;
  border-width: 2px;
  background: #050a0f;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.8);
}
.thanh-tien > i {
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px rgba(255,255,255,.28);
}
.thanh-tien > i::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.28) 45%, transparent 70%);
  background-size: 180px 100%;
  animation: sang-chay 2.8s linear infinite;
}
@keyframes sang-chay { to { background-position: 180px 0; } }

/* The nhiem vu nhu cac quest */
.viec {
  position: relative;
  min-height: 82px;
  overflow: hidden;
  transition: transform .12s, border-color .12s, filter .12s;
}
.viec::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(var(--lam), var(--xanh));
}
.viec:hover { transform: translateY(-2px); }
.viec.xong { opacity: .57; filter: saturate(.55); }
.viec.xong::before { background: var(--xanh); }
.viec .bt {
  height: 52px; width: 52px;
  display: grid; place-items: center;
  background: #0c1721;
  border: 2px solid #395066;
  border-radius: 10px;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,.45));
}
.viec .ten { font-size: 1.06em; color: #fff; }
.the-tag { border-color: #31475a; background: rgba(5,10,15,.72); }

/* Hotbar dieu huong */
.thanh-duoi {
  left: 50%; right: auto; bottom: max(8px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(720px, calc(100% - 18px));
  gap: 6px;
  padding: 7px;
  background: rgba(7,16,25,.94);
  border: 3px solid var(--vien);
  border-top-color: #3b5870;
  border-radius: 15px;
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
  backdrop-filter: blur(12px);
}
.thanh-duoi button {
  max-width: none;
  padding: 7px 3px 5px;
  border: 2px solid transparent;
  border-radius: 9px;
  transition: transform .12s, background .12s, border-color .12s;
}
.thanh-duoi button:hover { transform: translateY(-2px); background: rgba(255,255,255,.04); }
.thanh-duoi button .bt {
  width: 36px; height: 32px; display: grid; place-items: center;
  font-size: 1.5rem;
  filter: grayscale(.35) drop-shadow(0 2px 0 #000);
}
.thanh-duoi button.dang {
  color: #fff;
  background: linear-gradient(180deg, rgba(88,204,2,.22), rgba(88,204,2,.08));
  border-color: var(--xanh-dam);
  box-shadow: inset 0 1px rgba(255,255,255,.12), 0 3px 0 #183708;
}
.thanh-duoi button.dang .bt { filter: drop-shadow(0 2px 0 #000); transform: translateY(-2px) scale(1.08); }

/* Cong vao game va chon nhan vat */
.man-cong-game { max-width: 520px; padding-top: max(7vh, 38px); }
.logo-game {
  width: 104px; height: 104px; margin: 0 auto 12px; display: grid; place-items: center;
  font-size: 4.2rem;
  background: linear-gradient(145deg, #294c2b, #13271a);
  border: 4px solid #050a0f; border-top-color: #5d8a5a; border-radius: 20px;
  box-shadow: 0 8px 0 #050a0f, 0 0 50px rgba(88,204,2,.18);
  animation: logo-noi 3s ease-in-out infinite;
}
@keyframes logo-noi { 50% { transform: translateY(-6px) rotate(-2deg); } }
.ten-game {
  color: #fff; font-size: clamp(2.3rem, 10vw, 3.6rem); font-weight: 800;
  line-height: 1; letter-spacing: .04em;
  text-shadow: 0 5px 0 #153d08, 0 8px 0 #050a0f;
}
.phu-de-game { margin: 13px 0 16px; color: var(--vang); font-size: .74rem; font-weight: 800; letter-spacing: .15em; }
.the-cong-game { padding: 22px; }
.the-cong-game input { text-align: center; font-size: 1.15em; }
.dau-man-game { margin-top: 5vh; }
.dau-man-game h1 { margin-top: 5px; font-size: 2rem; }
.luoi-nguoi { gap: 18px; }
.the-nguoi {
  position: relative; width: 152px;
  background: linear-gradient(145deg, #1b3143, #10202d);
  border-width: 3px; border-top-color: color-mix(in srgb, currentColor, white 30%);
  box-shadow: 0 7px 0 #050a0f, 0 12px 24px rgba(0,0,0,.24);
  transition: transform .12s, filter .12s;
}
.the-nguoi:hover { transform: translateY(-5px); filter: brightness(1.12); }
.the-nguoi .mat { filter: drop-shadow(0 4px 0 rgba(0,0,0,.5)); }

/* The gioi va inventory */
.luoi-the-gioi {
  border-width: 5px;
  box-shadow: 0 7px 0 #050a0f, 0 12px 30px rgba(0,0,0,.32);
  background: #050a0f;
}
.luoi-the-gioi .o.trong {
  background:
    linear-gradient(135deg, rgba(255,255,255,.025) 25%, transparent 25%) 0 0/8px 8px,
    #10202c;
}
.o-kho .khoi { box-shadow: 0 3px 0 rgba(0,0,0,.55); }
.o-kho.chon .khoi {
  outline: 3px solid var(--vang); outline-offset: 3px;
  filter: brightness(1.15) drop-shadow(0 0 7px rgba(255,200,0,.45));
}
.khung-nv {
  background:
    radial-gradient(circle at 50% 20%, rgba(28,176,246,.16), transparent 55%),
    linear-gradient(#1a3041, #0b1721);
  border-top-color: #3d5d77;
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 4px 0 #050a0f;
}
.o-trang-bi {
  background: linear-gradient(145deg, #101e2a, #081119);
  border-color: #304a60;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.28);
}
.o-trang-bi.co { border-color: var(--lam); box-shadow: 0 0 12px rgba(28,176,246,.16); }
.the.vat-pham { background: linear-gradient(120deg, rgba(255,255,255,.04), transparent 45%), #172838; }
.the-thuong .gia { text-shadow: 0 2px 0 #6b4f00; }
.hang-bxh:first-of-type { margin-top: 8px; }

input, select, textarea {
  background: #08121b;
  border: 2px solid #314b61;
  box-shadow: inset 0 3px 7px rgba(0,0,0,.32);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(28,176,246,.35);
  box-shadow: 0 0 0 3px rgba(28,176,246,.16), inset 0 3px 7px rgba(0,0,0,.3);
}
.hop-thoai {
  border-top-color: #496982;
  box-shadow: 0 9px 0 #050a0f, 0 20px 60px rgba(0,0,0,.55);
}
.bao { box-shadow: 0 6px 0 #050a0f, 0 12px 30px rgba(0,0,0,.4); }

@media (max-width: 620px) {
  body { padding-bottom: 92px; }
  .man { padding: 14px 11px 28px; }
  .thanh-duoi { width: calc(100% - 10px); bottom: 4px; gap: 2px; padding: 5px; }
  .thanh-duoi button { font-size: .62rem; }
  .thanh-duoi button .bt { font-size: 1.28rem; width: 30px; }
  .dau-nguoi-choi { align-items: flex-start; }
  .dau-nguoi-choi .khung-nv { transform: scale(.9); transform-origin: left top; margin-right: -5px; }
  .viec { min-height: 76px; padding: 10px 9px; gap: 9px; }
  .viec .bt { width: 44px; height: 46px; font-size: 1.75rem; }
  .viec .nut { padding: 10px 12px; }
  .duong-hanh-trinh { margin-left: 13px; padding-left: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* ---------------- man nhan thuong ---------------- */
.nen-thuong-game {
  position: fixed; inset: 0; z-index: 110;
  display: grid; place-items: center; padding: 20px; overflow: hidden;
  background: radial-gradient(circle, rgba(19,54,71,.88), rgba(3,8,13,.96) 68%);
  animation: hien-nen-thuong .18s ease-out;
}
.tia-thuong {
  position: absolute; width: min(760px, 130vw); aspect-ratio: 1; opacity: .28;
  background: repeating-conic-gradient(from 0deg, var(--vang) 0deg 7deg, transparent 7deg 18deg);
  mask-image: radial-gradient(circle, black 0 12%, transparent 66%);
  -webkit-mask-image: radial-gradient(circle, black 0 12%, transparent 66%);
  animation: quay-tia 16s linear infinite;
}
.hop-thuong-game {
  position: relative; width: min(470px, 100%); text-align: center;
  padding: 28px 22px 20px;
  border: 4px solid #050a0f; border-top-color: #52738b; border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,.07), transparent 45%), #172838;
  box-shadow: 0 9px 0 #050a0f, 0 0 0 3px rgba(255,200,0,.14), 0 24px 70px #000;
  animation: bat-thuong .48s cubic-bezier(.17,.89,.32,1.35);
}
.nhan-thuong-game {
  color: var(--vang); font-size: .76rem; font-weight: 800; letter-spacing: .14em;
}
.icon-thuong-game {
  width: 98px; height: 98px; margin: 16px auto 12px;
  display: grid; place-items: center; font-size: 3.8rem;
  border: 4px solid #050a0f; border-top-color: #4a687f; border-radius: 18px;
  background: radial-gradient(circle at 50% 35%, #29485d, #0b1822);
  box-shadow: 0 7px 0 #050a0f, 0 0 30px rgba(255,200,0,.16);
  animation: nhay-icon-thuong .65s .25s both;
}
.hop-thuong-game h2 { margin: 5px 0 4px; color: #fff; font-size: 1.45rem; }
.hop-thuong-game p { margin: 0 auto; max-width: 360px; }
.dong-phan-thuong {
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 19px;
}
.o-phan-thuong {
  min-width: 132px; display: grid; grid-template-columns: 38px auto;
  grid-template-rows: auto auto; align-items: center; column-gap: 8px;
  padding: 10px 14px; text-align: left;
  border: 3px solid #050a0f; border-top-color: #49677f; border-radius: 12px;
  background: linear-gradient(#142536, #0b1721);
  box-shadow: 0 4px 0 #050a0f;
  animation: roi-phan-thuong .45s .36s both;
}
.o-phan-thuong > :first-child { grid-row: 1 / 3; }
.o-phan-thuong b { color: var(--vang); font-size: 1.2rem; line-height: 1; }
.o-phan-thuong > span:last-child { color: var(--chu-mo); font-size: .76rem; }
.bt-phan-thuong { font-size: 1.8rem; text-align: center; }
.khoi-thuong { width: 36px; height: 36px; }
.goi-y-bo-qua { margin-top: 18px; color: #7890a3; font-size: .72rem; font-weight: 700; }
.thuong-dang-dong { opacity: 0; transition: opacity .18s; }
.thuong-dang-dong .hop-thuong-game { transform: scale(.94); transition: transform .18s; }

@keyframes hien-nen-thuong { from { opacity: 0; } }
@keyframes quay-tia { to { transform: rotate(360deg); } }
@keyframes bat-thuong { from { transform: translateY(45px) scale(.78); opacity: 0; } }
@keyframes nhay-icon-thuong {
  0% { transform: scale(.35) rotate(-12deg); opacity: 0; }
  65% { transform: scale(1.12) rotate(4deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes roi-phan-thuong { from { transform: translateY(-14px); opacity: 0; } }

/* ---------------- quest board ---------------- */
.bang-quest-title {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px; padding: 13px 15px;
  border: 3px solid #050a0f; border-top-color: #4b6b82; border-radius: 14px;
  background: linear-gradient(90deg, rgba(255,200,0,.09), transparent 42%), linear-gradient(#1b3142, #112330);
  box-shadow: 0 5px 0 #050a0f;
}
.bang-quest-title h2 { margin: 2px 0 0; font-size: 1.18rem; }
.icon-bang-quest {
  width: 46px; height: 46px; display: grid; place-items: center;
  border: 2px solid #050a0f; border-radius: 10px; background: #0b1822;
  font-size: 1.7rem; box-shadow: inset 0 1px #3d586e;
}
.dem-quest {
  min-width: 48px; padding: 6px 10px; text-align: center;
  color: var(--vang); font-weight: 800; border: 2px solid #050a0f;
  border-radius: 9px; background: #08131c; box-shadow: inset 0 1px #334c60;
}
.nhan-nhom-quest {
  margin: 16px 3px 8px; color: #8da4b7;
  font-size: .72rem; font-weight: 800; letter-spacing: .12em;
}
.nut-mo-quest { display: block; width: 100%; margin-top: 15px; border-style: dashed; }
.viec.lv-hoc::before { background: linear-gradient(#42c5ff, #167fc7); }
.viec.lv-viec_nha::before { background: linear-gradient(#70dc19, #3b9c08); }
.viec.lv-giup_do::before { background: linear-gradient(#ffce2f, #ed8d13); }
.viec.lv-ban_than::before { background: linear-gradient(#d99cff, #8758d8); }
.do-kho { color: #647e92; letter-spacing: 1px; }
.do-kho-2 .do-kho { color: var(--lam); }
.do-kho-3 .do-kho { color: var(--cam); text-shadow: 0 0 7px rgba(255,150,0,.35); }
.the-quet-sach {
  padding: 28px 18px;
  background: radial-gradient(circle at 50% 20%, rgba(255,200,0,.18), transparent 45%), linear-gradient(145deg, #1d3542, #11222f);
}
.cup-quet-sach {
  font-size: 4rem; line-height: 1; margin-bottom: 10px;
  filter: drop-shadow(0 5px 0 #5f4600);
  animation: logo-noi 2.6s ease-in-out infinite;
}
.the-quet-sach h2 { color: var(--vang); margin-bottom: 5px; }

/* ---------------- vay muon anh em ---------------- */
.khu-vay-muon {
  border-color: #245271; border-top-color: #56c7ff;
  background: linear-gradient(120deg, rgba(28,176,246,.12), transparent 42%), #172838;
}
.khu-vay-muon h2 { margin: 1px 0 2px; }
.bt-vay, .icon-vay-xp {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border: 2px solid #071019; border-radius: 10px; background: #0b1b27; font-size: 1.6rem;
}
.dong-vay {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px;
  border: 2px solid #29465a; border-radius: 10px; background: rgba(5,12,18,.55);
}
.hang-nut-vay { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.hang-nut-vay .nut { padding: 8px 10px; font-size: .8rem; }
@media (max-width: 520px) {
  .khu-vay-muon > .hang { flex-wrap: wrap; }
  .khu-vay-muon > .hang > .nut { width: 100%; }
  .dong-vay { align-items: flex-start; }
}

/* ---------------- gioi han thoi gian game ---------------- */
.thoi-gian-choi {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 13px; padding: 9px 12px;
  border: 2px solid #2f485c; border-radius: 11px;
  background: rgba(8,19,28,.82); color: #9fb3c6;
  font-size: .78rem; box-shadow: 0 3px 0 #050a0f;
}
.thoi-gian-choi .hang { margin-bottom: 4px; }
.thoi-gian-choi .thanh-tien { height: 9px; border-width: 1px; padding: 1px; }
.thoi-gian-choi .thanh-tien > i { background: linear-gradient(90deg, var(--lam), var(--vang), var(--do)); }
.thoi-gian-choi.het {
  border-color: #594f72;
  background: linear-gradient(90deg, rgba(110,79,160,.16), rgba(8,19,28,.9));
}
.thoi-gian-choi.het .thanh-tien > i { background: #746489; }
.thanh-duoi button:disabled {
  opacity: .32; cursor: not-allowed; filter: grayscale(1);
}
.thanh-duoi button:disabled:hover { transform: none; background: none; }
body.che-do-nghi .be-vuong { animation: none; filter: saturate(.45); }
.nut-them-gio { border: 1px solid #75642d; border-radius: 8px; padding: 5px 7px; background: #332c14; color: var(--vang); font-weight: 900; }

/* ---------------- Dai Luc FamilyG ---------------- */
.chon-che-do-the-gioi { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.chon-che-do-the-gioi .nut { padding: 10px; }
.dau-kham-pha { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dau-kham-pha h1 { margin: 3px 0; }
.nang-luong-kham-pha { flex: none; padding: 9px 12px; border: 2px solid #8d7626; border-radius: 10px; background: linear-gradient(#473c19,#29220d); color: #ffe06b; font-weight: 900; box-shadow: 0 4px 0 #100d05; }
.danh-sach-vung { display: flex; gap: 7px; overflow-x: auto; padding: 7px 1px; }
.chip-vung { flex: none; border: 2px solid #30495d; border-radius: 9px; padding: 7px 9px; background: #10202d; color: var(--chu-mo); font-weight: 800; }
.chip-vung.dang { border-color: var(--xanh); color: #dfffcf; background: #17351f; }
.chip-vung:disabled { opacity: .45; }
.ban-do-kham-pha { display: grid; width: min(610px, 92vw); aspect-ratio: 1; gap: 2px; padding: 8px; border: 4px solid #554424; border-radius: 13px; background: #10181d; box-shadow: 0 7px 0 #05090c, inset 0 0 35px #030607; }
.o-kham-pha { min-width: 0; padding: 0; border: 1px solid rgba(255,255,255,.08); border-radius: 4px; display: grid; place-items: center; color: #eef8e8; font-size: clamp(.68rem, 3.3vw, 1.35rem); text-shadow: 0 2px #000; transition: transform .12s, filter .12s; }
.o-kham-pha.da-mo { background: #315d36; }
.o-kham-pha.dia-hoa { background: #486a38; color: #ffd7ee; }
.o-kham-pha.dia-da { background: #59646a; }
.o-kham-pha.dia-nuoc { background: #246684; }
.o-kham-pha.dia-cay { background: #28582e; }
.o-kham-pha.suong { border-color: transparent; background: radial-gradient(circle,#17232b,#080e12); }
.o-kham-pha.sat-ben { background: #1b2c34; border: 1px dashed #6e8999; color: #91a5ae; animation: o-goi 1.8s infinite; }
.o-kham-pha.dang-dung { outline: 3px solid #ffe468; z-index: 2; transform: scale(1.13); background: #655827; }
.o-kham-pha.da-nhan { filter: saturate(.45); opacity: .72; }
.chu-giai-kham-pha { margin-top: 9px; line-height: 1.7; color: #c7d8e4; }
.bo-suu-tap { display: flex; flex-wrap: wrap; gap: 8px; }
.mon-suu-tap { padding: 7px 9px; border: 2px solid #46566b; border-radius: 8px; background: #0a151e; font-weight: 700; }
.dong-nhat-ky { padding: 6px 0; border-bottom: 1px solid #263746; }
@keyframes o-goi { 50% { filter: brightness(1.55); } }

/* ---------------- ruong vat pham hiem ---------------- */
.ruong-hiem {
  display: flex; align-items: center; gap: 16px;
  border-color: #442b70; border-top-color: #b785ff;
  background:
    radial-gradient(circle at 12% 20%, rgba(206,130,255,.25), transparent 32%),
    linear-gradient(120deg, #281c3f, #172838 60%);
  box-shadow: 0 6px 0 #09050f, 0 0 28px rgba(160,89,255,.15);
}
.ruong-hiem h2 { margin: 2px 0 3px; }
.ruong-hinh {
  width: 74px; height: 74px; flex: none; display: grid; place-items: center;
  font-size: 3rem; border: 3px solid #10091b; border-top-color: #b785ff;
  border-radius: 15px; background: radial-gradient(circle, #634097, #211333);
  box-shadow: 0 5px 0 #09050f, 0 0 20px rgba(206,130,255,.24);
  animation: ruong-tho 2.6s ease-in-out infinite;
}
.bao-hiem-ruong { color: #d7b9ff; font-size: .78rem; margin-top: 5px; }
.cot-ve { flex: none; text-align: center; }
.so-ve { color: var(--vang); font-size: 1.05rem; font-weight: 800; margin-bottom: 6px; }
.nut-ruong {
  color: #fff; background: linear-gradient(#a764ef, #7540ba);
  box-shadow: 0 4px 0 #45236e; padding: 10px 14px;
}
@keyframes ruong-tho {
  50% { transform: translateY(-3px); filter: brightness(1.15); box-shadow: 0 8px 0 #09050f, 0 0 30px rgba(206,130,255,.38); }
}
@media (max-width: 520px) {
  .ruong-hiem { align-items: flex-start; gap: 10px; padding: 12px; }
  .ruong-hinh { width: 58px; height: 58px; font-size: 2.25rem; }
  .ruong-hiem h2 { font-size: 1rem; }
  .ruong-hiem .mo, .bao-hiem-ruong { font-size: .67rem; }
  .cot-ve .nut { padding: 8px 9px; font-size: .78rem; }
}
