:root { --c: #2F8FD8; --c2: #FFB63D; --bg: #0E2A3D; --the: #13324a; --the2: #1b4060; --chu: #eef6ff; --mut: #8fb0c8; --do: #ff5a4a;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); font-family: "Be Vietnam Pro", system-ui, sans-serif; color: var(--chu); overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
button { font: inherit; cursor: pointer; color: inherit; }

/* lớp mây đen khi mưa bão */
#upToi { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .6s; background: radial-gradient(120% 80% at 50% 40%, rgba(20,30,45,.35), rgba(8,12,22,.85)); }

/* HUD trên */
#upHud { position: fixed; left: 8px; right: 8px; top: calc(var(--sat) + 8px); z-index: 10; display: none; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
#upHud.on { display: grid; }
#upHud .dung { min-width: 52px; min-height: 48px; border: 0; border-radius: 14px; background: rgba(10,26,40,.82); color: #fff; padding: 4px 8px; }
#upHud .dung b { display: block; font-size: 15px; } #upHud .dung small { display: block; font-size: 11px; font-weight: 800; }
#upHud .giua { background: rgba(10,26,40,.82); border-radius: 14px; padding: 6px 10px; min-width: 0; }
#upHud .giua b { display: block; font-size: 14px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#upHud .giua small { display: block; font-size: 12px; font-weight: 700; color: #bfe1ff; white-space: nowrap; }
#upHud .phai { background: rgba(10,26,40,.82); border-radius: 14px; padding: 6px 10px; display: flex; flex-direction: column; gap: 3px; min-width: 112px; }
#upHud .vt { font-size: 15px; font-weight: 900; color: #ffd36b; }
#upHud .an i { display: block; height: 7px; border-radius: 4px; background: #08141f; overflow: hidden; }
#upHud .an em { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #4fd18b, #8ff0b8); transition: width .3s; }
#upHud .an small { display: block; font-size: 11px; font-weight: 800; color: #cfeedd; }
#upHud.nguy .an em { background: linear-gradient(90deg, #ff6a4a, #ffb03d); } #upHud.nguy .an small { color: #ffc9b8; }

/* thẻ dự báo */
#upThe { position: fixed; left: 8px; right: 8px; top: calc(var(--sat) + 66px); z-index: 10; display: none; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,250,236,.96), rgba(255,240,206,.96)); color: #3a2a12; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
#upThe.on { display: flex; }
#upThe .k { font-size: 30px; line-height: 1; }
#upThe small { display: block; font-size: 11px; font-weight: 800; color: #a0661a; text-transform: uppercase; letter-spacing: .4px; }
#upThe b { display: block; font-size: 16px; font-weight: 900; }
#upThe span { display: block; font-size: 12px; font-weight: 700; color: #5a4a2a; }
#upThe.dot { background: linear-gradient(180deg, rgba(24,58,92,.95), rgba(14,40,66,.95)); color: #fff; }
#upThe.dot small { color: #9fd6ff; } #upThe.dot span { color: #d8ecff; }

/* nút Sẵn sàng */
#upSS { position: fixed; left: 12px; right: 12px; bottom: calc(var(--sab) + 104px); z-index: 10; display: none; }
#upSS.on { display: block; }
#upSS button { width: 100%; min-height: 54px; border: 0; border-radius: 16px; background: linear-gradient(180deg, #ffc65a, #ff9a2a); color: #2a1804; box-shadow: 0 6px 18px rgba(0,0,0,.3); padding: 6px 10px; }
#upSS b { display: block; font-size: 17px; font-weight: 900; } #upSS small { display: block; font-size: 12px; font-weight: 800; opacity: .85; }

/* khay công trình */
#upKhay { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: none; padding: 6px 6px calc(var(--sab) + 8px); background: linear-gradient(180deg, rgba(8,22,36,0), rgba(8,22,36,.9) 30%); }
#upKhay.on { display: block; }
#upKhay .ds { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 2px; }
#upKhay .ds::-webkit-scrollbar { display: none; }
#upKhay .cc { flex: 0 0 auto; width: 74px; min-height: 86px; border: 2px solid transparent; border-radius: 14px; background: rgba(27,64,96,.95); color: #fff; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
#upKhay .cc b { font-size: 11.5px; font-weight: 900; line-height: 1.15; text-align: center; }
#upKhay .cc small { font-size: 10.5px; font-weight: 800; color: #ffd36b; }
#upKhay .cc.chon { border-color: #ffd36b; background: rgba(60,92,124,.98); box-shadow: 0 0 0 3px rgba(255,211,107,.25); }
#upKhay .cc.khoa { opacity: .42; }

/* bàn tay gợi ý */
#upTay { position: fixed; left: 0; top: 0; z-index: 12; pointer-events: none; display: none; }
#upTay.on { display: block; }
#upTay i { position: absolute; left: -14px; top: 0; font-size: 34px; font-style: normal; animation: upTay 1s ease-in-out infinite; filter: drop-shadow(0 3px 6px rgba(0,0,0,.4)); }
#upTay span { position: absolute; top: 44px; width: 220px; padding: 6px 10px; border-radius: 12px; background: #fff7e0; color: #3a2a12; font-size: 13px; font-weight: 800; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
@keyframes upTay { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* băng chữ giữa màn */
#upBan { position: fixed; left: 50%; bottom: calc(var(--sab) + 172px); z-index: 11; transform: translate(-50%, 0) scale(.9); opacity: 0; pointer-events: none; text-align: center; width: min(92vw, 420px);
  padding: 9px 14px; border-radius: 16px; background: rgba(8,22,36,.82); box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: opacity .25s, transform .25s; }
#upBan.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
#upBan b { display: block; font-size: 18px; font-weight: 900; color: #fff; }
#upBan span { display: block; margin-top: 3px; font-size: 13px; font-weight: 700; color: #cfe6ff; line-height: 1.4; }

/* màn chính */
#menu { position: fixed; inset: 0; z-index: 20; display: none; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#menu.on { display: block; }
#menu.nen { background: rgba(4,14,24,.72); }
.home { max-width: 520px; margin: 0 auto; padding: calc(var(--sat) + 66px) 12px calc(var(--sab) + 24px); }
.logo { display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 4px; }
.logo img { border-radius: 14px; box-shadow: 0 6px 16px rgba(0,0,0,.4); }
.logo h1 { margin: 0; font-size: 30px; font-weight: 900; line-height: 1; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.45); }
.logo p { margin: 3px 0 0; font-weight: 800; font-size: 13px; color: #fff3c8; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.mo { height: 34vh; }
.sheet { background: linear-gradient(180deg, rgba(16,44,68,.97), rgba(9,28,44,.98)); border: 1px solid #22506f; border-radius: 22px; padding: 14px; box-shadow: 0 -8px 30px rgba(0,0,0,.35); }
.btn { display: block; width: 100%; min-height: 52px; border: 0; border-radius: 16px; background: var(--the2); color: var(--chu); font-weight: 800; font-size: 16px; margin: 8px 0; padding: 10px 14px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.btn small { display: block; font-size: 13px; font-weight: 700; opacity: .9; margin-top: 2px; }
.btn.main { background: linear-gradient(180deg, #ffc65a, #ff9a2a); color: #2a1804; }
.btn.big { min-height: 74px; font-size: 22px; font-weight: 900; margin-top: 0; }
.btn.ngay { background: linear-gradient(180deg, #1f5a86, #174566); text-align: left; }
.btn.ngay b { color: #cfeaff; }
.btn.ngay.bao { background: linear-gradient(180deg, #3a3f7a, #2a2f62); }
.btn.khoa { opacity: .55; }
.sheet h3 { margin: 16px 2px 8px; font-size: 15px; font-weight: 900; display: flex; justify-content: space-between; align-items: baseline; }
.sheet h3 small { font-size: 12px; color: var(--mut); font-weight: 700; }
.mans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mans .d { min-height: 62px; border: 2px solid #22506f; border-radius: 12px; background: var(--the); padding: 4px 2px; }
.mans .d i { display: block; font-style: normal; font-size: 14px; line-height: 1; }
.mans .d b { display: block; font-size: 18px; font-weight: 900; } .mans .d small { display: block; font-size: 10px; font-weight: 800; color: #ffd36b; }
.mans .d.chon { border-color: #ffc65a; background: #24405a; }
.mans .d.khoa { opacity: .45; } .mans .d.khoa small { color: var(--mut); }
.viec > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 10px; background: var(--the); border-radius: 12px; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.viec > div i { grid-column: 1; display: block; height: 5px; background: #06121c; border-radius: 4px; overflow: hidden; } .viec > div em { display: block; height: 100%; background: var(--c2); }
.viec > div b { grid-row: 1 / 3; grid-column: 2; align-self: center; color: #ffd36b; font-size: 12px; }
.viec > div.xong { opacity: .6; }
.hang { display: flex; gap: 8px; margin-top: 8px; }
.link { border: 0; background: var(--the2); color: var(--chu); border-radius: 14px; min-height: 46px; padding: 10px 12px; font-weight: 800; font-size: 14px; width: 100%; margin-top: 8px; }
.hang .link { margin-top: 0; } .link small { color: #ffd36b; }
.panel { background: #f6f9fb; color: #15283a; border-radius: 22px; padding: 18px; max-width: 480px; margin: calc(var(--sat) + 40px) auto 24px; width: calc(100% - 24px); }
.panel h2 { margin: 0 0 8px; display: flex; justify-content: space-between; align-items: baseline; } .panel h2 small { font-size: 14px; color: #a86a12; }
.panel h3 { margin: 14px 0 4px; font-size: 15px; }
.panel p, .panel li { color: #43586c; font-weight: 600; line-height: 1.5; font-size: 14px; }
.panel ul { padding-left: 18px; margin: 4px 0; } .panel li { margin: 5px 0; } .panel li.chua { opacity: .55; } .panel li b { color: #15283a; } .panel li em { display: block; font-style: normal; color: #2f6f9f; }
.panel li svg { width: 20px; height: 20px; vertical-align: -4px; }
.panel .btn { background: #e3ebf2; color: #15283a; } .panel .btn.main { background: linear-gradient(180deg, #ffc65a, #ff9a2a); color: #2a1804; }
.nc { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #dde6ee; }
.nc > i { font-size: 26px; font-style: normal; } .nc span { flex: 1; } .nc b { display: block; font-size: 14px; } .nc b small { color: #c48a1a; letter-spacing: 1px; } .nc em { display: block; font-style: normal; font-size: 12px; color: #5d6a8a; font-weight: 600; }
.nc button { border: 0; border-radius: 12px; background: #ffb63d; color: #2a1804; font-weight: 900; padding: 10px 12px; min-height: 44px; min-width: 76px; } .nc button.thieu { background: #e3e8ee; color: #7a8a9a; } .nc button:disabled { background: #d9f2e2; color: #2a7a4a; }
.foot { color: #cfe6ff; font-size: 13px; text-align: center; opacity: .85; margin-top: 14px; }
.foot a { color: #fff; }
body.dangdung .agt-bar { display: none; }
