:root { --c: #7a3b1d; --c2: #e0a030; --bg: #160d08; --ink: #14203d; --mut: #5d6a8a; --sat: env(safe-area-inset-top, 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(--ink); overscroll-behavior: none; }
canvas#c { position: fixed; inset: 0; touch-action: none; display: block; }
#menu { position: fixed; inset: 0; z-index: 20; display: none; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#menu.on { display: block; }
button { font: inherit; cursor: pointer; color: inherit; }
.home { min-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: calc(var(--sat) + 76px) 16px 32px; max-width: 520px; margin: 0 auto; }
.logo { text-align: center; color: #fff; text-shadow: 0 4px 18px rgba(0,0,0,.3); }
.logo .mark { width: 76px; height: 76px; margin: 0 auto 6px; border-radius: 24px; display: grid; place-items: center; font-size: 42px; background: linear-gradient(135deg, var(--c2), var(--c)); box-shadow: 0 10px 30px rgba(0,0,0,.3); transform: rotate(-8deg); }
.logo h1 { margin: 0; font-size: clamp(40px, 11vw, 60px); font-weight: 900; letter-spacing: -1px; line-height: 1; }
.logo p { margin: 4px 0 0; font-weight: 800; font-size: 18px; }
.story { color: #fff; text-align: center; font-weight: 600; margin: 0; opacity: .92; }
.btn { display: block; width: 100%; min-height: 52px; border: 0; border-radius: 18px; background: #fff; font-weight: 800; font-size: 17px; margin: 8px 0; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.btn.main { background: linear-gradient(180deg, var(--c2), var(--c)); color: #fff; }
.btn.big { min-height: 72px; font-size: 24px; font-weight: 900; }
.btn.big small { display: block; font-size: 14px; font-weight: 700; opacity: .9; }
.link { border: 0; background: rgba(255,255,255,.88); border-radius: 14px; padding: 12px 16px; font-weight: 800; width: 100%; }
.panel { background: #fff; border-radius: 22px; padding: 20px; max-width: 480px; margin: calc(var(--sat) + 70px) auto 24px; width: calc(100% - 32px); }
.panel h2 { margin: 0 0 8px; }
.panel p, .panel li { color: var(--mut); font-weight: 600; line-height: 1.5; }
.foot { color: #fff; font-size: 13px; text-align: center; opacity: .85; }
.foot a { color: #fff; }
/* LINHUNG_v1 — sân chùa, chính điện, dock việc, panel */
.home { justify-content: space-between; padding-bottom: 22px; padding-top: calc(var(--sat) + 64px); min-height: 100dvh; }
.home .dau { text-align: center; }
.home .logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; }
.home .logo img { width: 52px; height: 52px; margin: 0; border-radius: 14px; }
.home .logo h1 { font-size: 34px; }
.home .logo p { display: none; }
.home .khau { color: #fff; font-weight: 800; font-size: 15px; margin: 4px 0 0; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.lich { text-align: center; color: #fff; font-weight: 700; font-size: 14px; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.lich b { font-weight: 900; }
.lich .le { display: block; margin: 6px auto 0; width: max-content; max-width: 90%; background: rgba(242,184,75,.92); color: #3a2412; padding: 4px 12px; border-radius: 999px; font-weight: 800; }
.logo img { display: block; margin: 0 auto 6px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.the { width: 100%; background: rgba(29,20,13,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 24px; padding: 14px; color: #f6e9d2; }
.the .song { margin: 0 0 6px; font-size: 14px; text-align: center; line-height: 1.5; }
.the .song small { opacity: .8; }
.bao { background: rgba(242,184,75,.18); border: 1px solid rgba(242,184,75,.5); color: #ffe2a6; border-radius: 14px; padding: 8px 12px; font-weight: 800; font-size: 14px; text-align: center; margin: 6px 0; }
.hai { display: flex; gap: 8px; }
.hai .btn { margin: 4px 0; font-size: 15px; min-height: 48px; color: #3a2412; background: #fff6e4; }
.the .link { background: rgba(255,255,255,.12); color: #f6e9d2; margin-top: 6px; }
.panel input, #panel input { width: 100%; min-height: 48px; border: 1px solid #e3d3b6; border-radius: 14px; padding: 0 14px; font: inherit; font-size: 16px; margin: 8px 0; background: #fffaf0; }
.nho { font-size: 13px; color: var(--mut); font-weight: 600; margin: 6px 0; }
.panel h3 { margin: 16px 0 6px; font-size: 15px; color: #8a5a2b; }
.so .chuoi { font-size: 18px; font-weight: 900; color: #3a2412; margin: 0; }
.so .luoi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.so .luoi div { background: #fbf3e4; border-radius: 12px; padding: 8px; text-align: center; }
.so .luoi b { display: block; font-size: 20px; color: #3a2412; }
.so .luoi span { font-size: 12px; color: var(--mut); font-weight: 700; }
.lich28 { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; }
.lich28 i { aspect-ratio: 1; border-radius: 4px; background: #efe6d6; }
.lich28 .m1 { background: #f3d9a4; } .lich28 .m2 { background: #e8b75c; } .lich28 .m3 { background: #c98a2c; } .lich28 .m4 { background: #8a5a2b; }
.huy { display: grid; gap: 6px; }
.huy div { background: #f6f1e8; border-radius: 12px; padding: 8px 10px; opacity: .55; }
.huy div.co { background: #fff3d6; opacity: 1; }
.huy small { display: block; color: var(--mut); font-weight: 600; }
.ao { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 8px 0; }
.ao button { border: 2px solid #eadfcd; background: #fff; border-radius: 12px; min-height: 44px; font-weight: 700; display: flex; align-items: center; gap: 8px; padding: 0 10px; font-size: 13px; }
.ao button.on { border-color: #8a5a2b; }
.ao i { width: 18px; height: 18px; border-radius: 50%; flex: none; }
#tren { position: fixed; z-index: 15; left: 8px; right: 8px; top: calc(var(--sat) + 58px); display: none; align-items: center; gap: 8px; }
#tren.on { display: flex; }
#tren button { border: 0; min-height: 40px; border-radius: 12px; padding: 0 12px; font-weight: 800; background: rgba(255,248,235,.9); color: #3a2412; font-size: 14px; }
#tren .tt { flex: 1; text-align: center; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.6); line-height: 1.2; }
#tren .tt b { display: block; font-size: 14px; } #tren .tt small { font-size: 12px; font-weight: 700; opacity: .9; }
#dock { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; display: none; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px 8px calc(env(safe-area-inset-bottom, 0px) + 8px); background: linear-gradient(180deg, rgba(29,20,13,0), rgba(29,20,13,.92) 22%); }
#dock.on { display: grid; }
#dock button { border: 0; border-radius: 14px; min-height: 58px; background: rgba(255,246,228,.94); color: #3a2412; font-weight: 800; font-size: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 2px; }
#dock button i { font-style: normal; font-size: 22px; line-height: 1; }
#dock button.on { background: linear-gradient(180deg, #f2b84b, #c98a2c); color: #2a1608; }
#panel { position: fixed; z-index: 16; left: 8px; right: 8px; bottom: calc(env(safe-area-inset-bottom, 0px) + 144px); display: none; background: rgba(255,248,235,.96); border-radius: 18px; padding: 10px 12px; max-width: 560px; margin: 0 auto; max-height: 45dvh; overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
#panel.on { display: block; }
#panel .pr { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
#panel .pr::-webkit-scrollbar { display: none; }
#panel .pr > * { flex: none; }
#panel .pr .lon { flex: 1 1 auto; width: auto; }
#panel .lon { border: 0; min-height: 52px; padding: 0 22px; border-radius: 16px; font-weight: 900; font-size: 18px; color: #fff; background: linear-gradient(180deg, #c98a2c, #8a5a2b); width: 100%; }
#panel .lon:disabled { opacity: .5; }
#panel .chip { border: 1px solid #e3d3b6; background: #fff; border-radius: 999px; min-height: 40px; padding: 0 14px; font-weight: 800; font-size: 13px; color: #3a2412; }
#panel .chip.on { background: #f2b84b; border-color: #c98a2c; }
#panel .chk { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; min-height: 40px; }
#panel .chk input { width: 22px; height: 22px; min-height: 0; margin: 0; }
#panel .ds { display: grid; gap: 6px; }
#panel .ds button { border: 0; background: #fbf3e4; border-radius: 14px; padding: 10px 12px; text-align: left; }
#panel .ds b { display: block; color: #3a2412; } #panel .ds small { color: var(--mut); font-weight: 600; font-size: 12px; }
#panel .dong { border: 0; background: transparent; color: #8a5a2b; font-weight: 800; min-height: 40px; width: 100%; margin-top: 0; }
#panel .nho { margin: 4px 0 0; }

.bon { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0; }
.bon button { border: 0; border-radius: 14px; min-height: 60px; background: #fff6e4; color: #3a2412; font-weight: 800; font-size: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.bon i { font-style: normal; font-size: 22px; }
.the .foot { font-size: 12px; margin: 6px 0 0; }
.the .link { min-height: 44px; padding: 8px 12px; font-size: 14px; }
body.tinh #panel { bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); }
#chao { position: fixed; z-index: 17; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 150px); display: none; border: 0; border-radius: 999px; min-height: 48px; padding: 0 20px; font: inherit; font-weight: 800; font-size: 15px; color: #2a1608; background: linear-gradient(180deg, #f6d27a, #e0a840); box-shadow: 0 8px 24px rgba(0,0,0,.35); white-space: nowrap; }
#chao.on { display: block; }
.panel .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.panel .chips button { border: 1px solid #e3d3b6; background: #fff; border-radius: 999px; min-height: 40px; padding: 0 14px; font-weight: 800; font-size: 14px; color: #3a2412; }
.panel .chips button.on { background: #f2b84b; border-color: #c98a2c; }
.panel .hanh { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.panel .hanh button { border: 0; background: #fbf3e4; border-radius: 14px; padding: 10px; text-align: left; min-height: 56px; }
.panel .hanh b { display: block; color: #3a2412; } .panel .hanh small { color: var(--mut); font-weight: 600; font-size: 12px; }
.phapdanh { text-align: center; background: linear-gradient(180deg, #fff3d6, #f6dfae); border-radius: 18px; padding: 16px; margin: 8px 0; }
.phapdanh small { display: block; color: #8a5a2b; font-weight: 800; } .phapdanh b { display: block; font-size: 34px; color: #5a2a12; margin: 4px 0; } .phapdanh span { color: #6d4a2a; font-weight: 700; font-size: 14px; }
.chk2 { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: #3a2412; min-height: 44px; }
.chk2 input { width: 22px; height: 22px; min-height: 0; margin: 0; }
a.btn.nhac { text-align: center; line-height: 52px; text-decoration: none; }
#tren .tt .gian { border: 0; background: rgba(255,248,235,.22); color: #fff; font: inherit; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 4px 10px; min-height: 30px; margin-top: 2px; }
.btn.qa { background: linear-gradient(180deg, #fbf8f2, #e9e1d2); color: #3a2412; }
.btn.qa small { display: block; font-size: 13px; font-weight: 700; opacity: .8; }
.vpl { font-size: 13px; margin: 8px 0 0; text-align: center; color: #f6e9d2; line-height: 1.6; } .vpl a { color: #ffd27a; font-weight: 700; }
#panel .nho a { color: #8a5a2b; font-weight: 800; }
.gians .dsg { display: grid; gap: 6px; margin: 8px 0; max-height: 46dvh; overflow-y: auto; }
.gians .hang { display: grid; grid-template-columns: 70px 1fr 54px; align-items: center; gap: 8px; border: 1px solid #eadfcd; background: #fff; border-radius: 12px; min-height: 46px; padding: 0 10px; font: inherit; color: #3a2412; }
.gians .hang.on { border-color: #c98a2c; background: #fff3d6; } .gians .hang:disabled { opacity: .5; }
.gians .hang i { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #c98a2c var(--p), #efe6d6 var(--p)); }
.gians .hang span { font-weight: 800; font-size: 13px; text-align: right; }
/* VIEC_LANH_v1 · DANG_LE_v1 */
#tren .vlb { background: rgba(242,184,75,.92); color: #3a2412; }
.vl { display: grid; gap: 6px; margin: 10px 0; }
.vl div { display: flex; align-items: center; gap: 10px; background: #f6f1e8; border-radius: 12px; padding: 10px 12px; }
.vl div.xong { background: #fff3d6; } .vl i { font-style: normal; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #fff; font-size: 16px; } .vl .xong i { background: #f2b84b; color: #3a2412; font-weight: 900; }
.lich28 i.sen { box-shadow: inset 0 0 0 2px #f2b84b; }
.the .vlhome { background: rgba(242,184,75,.2); color: #ffe2a6; font-weight: 800; }
#panel .pr.ba { gap: 6px; } #panel .pr.ba .lon { flex: 1 1 0; padding: 0 8px; font-size: 15px; min-width: 0; }
/* CHUC_VIEC_v1 · GIAN_RIENG_v1 */
.cv { display: grid; gap: 6px; }
.cv button { position: relative; text-align: left; border: 1px solid #eadfcd; background: #fff; border-radius: 12px; padding: 10px 12px 18px; font: inherit; color: #3a2412; }
.cv button.co { background: #fff3d6; } .cv button.on { border-color: #c98a2c; box-shadow: 0 0 0 2px #f2b84b inset; } .cv button:disabled { opacity: .75; }
.cv small { display: block; color: var(--mut); font-weight: 600; font-size: 12px; }
.cv i { position: absolute; left: 12px; right: 70px; bottom: 8px; height: 5px; border-radius: 3px; background: linear-gradient(90deg, #c98a2c var(--p), #efe6d6 var(--p)); }
.cv em { position: absolute; right: 12px; bottom: 3px; font-style: normal; font-size: 11px; font-weight: 800; color: #8a5a2b; }
.grieng { margin: 12px 0; padding: 12px; border-radius: 16px; background: #fbf3e4; }
.grieng h3 { margin: 0 0 6px; } .grieng input { margin: 6px 0; }
/* BAN_DO_CHUA_v1 */
.bando .noi { display: block; width: 100%; text-align: left; border: 0; background: #fbf3e4; border-radius: 16px; padding: 12px 14px; margin: 6px 0; position: relative; font: inherit; color: #3a2412; }
.bando .noi b { display: block; font-size: 17px; } .bando .noi small { color: var(--mut); font-weight: 600; } .bando .noi em { position: absolute; right: 14px; top: 12px; font-style: normal; font-weight: 800; color: #8a5a2b; font-size: 13px; }
/* DI_LAI_v1 — nút camera */
#camNut { position: fixed; z-index: 14; right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 160px); display: none; flex-direction: column; gap: 6px; }
#camNut.on { display: flex; }
#camNut button { width: 44px; height: 44px; border: 0; border-radius: 14px; background: rgba(255,248,235,.88); color: #3a2412; font-size: 22px; font-weight: 900; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
body.tinh #camNut, #panel.on ~ #camNut { display: none; }
#camNut button { display: grid; place-items: center; }
/* CHUACHIEN_v1 — 3D: lớp vẽ 2D, gợi ý tại chỗ, nút đi tới */
canvas#hud { position: fixed; inset: 0; pointer-events: none; z-index: 2; display: block; }
canvas#c { z-index: 1; }
#menu { background: transparent; }
.home .the { background: rgba(26,15,8,.66); }
.home { justify-content: space-between; }
.home .dau { background: linear-gradient(180deg, rgba(20,10,4,.45), rgba(20,10,4,0)); border-radius: 22px; padding: 8px 10px 14px; }
#goiy { position: fixed; z-index: 17; left: 10px; right: 64px; margin: 0 auto; max-width: 420px; bottom: calc(env(safe-area-inset-bottom, 0px) + 158px); display: none; border: 0; border-radius: 20px; min-height: 56px; padding: 8px 22px; font: inherit; font-weight: 900; font-size: 17px; color: #2a1608; background: linear-gradient(180deg, #ffe08a, #e0a840); box-shadow: 0 10px 28px rgba(0,0,0,.4), 0 0 0 3px rgba(255,236,170,.35); animation: nhip 1.6s ease-in-out infinite; }
#goiy small { display: block; font-size: 12px; font-weight: 700; opacity: .8; }
#goiy.on { display: block; }
@keyframes nhip { 50% { box-shadow: 0 10px 28px rgba(0,0,0,.4), 0 0 0 9px rgba(255,236,170,.12); } }
#ditoi { position: fixed; z-index: 14; left: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 160px); display: none; border: 0; border-radius: 14px; min-height: 44px; padding: 0 14px; font: inherit; font-weight: 800; font-size: 14px; background: rgba(255,248,235,.9); color: #3a2412; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
#ditoi.on { display: block; }
body.tinh #ditoi, #panel.on ~ #ditoi, #goiy.on ~ #ditoi { display: none; }
#camNut { z-index: 14; }
#panel.on ~ #camNut, body.tinh #camNut { display: none; }
#tren #raCong { white-space: nowrap; }
.dsd { display: grid; gap: 6px; margin: 10px 0; }
.dsd button { display: flex; align-items: center; gap: 10px; border: 0; background: #fbf3e4; border-radius: 14px; min-height: 52px; padding: 0 14px; font: inherit; font-weight: 800; color: #3a2412; text-align: left; }
.dsd i { font-style: normal; font-size: 22px; }
.bando .bdsvg { width: 100%; height: auto; display: block; margin: 6px 0 4px; }
.bando .noi.on { box-shadow: inset 0 0 0 2px #c98a2c; }
.so .ba { display: flex; flex-wrap: wrap; gap: 6px; }
.so .ba span { background: #f6f1e8; border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: 13px; opacity: .55; color: #3a2412; }
.so .ba span.co { background: #fff3d6; opacity: 1; box-shadow: inset 0 0 0 1px #f2b84b; }
.btn:disabled { opacity: .55; }
/* trang chủ gọn hơn để thấy chùa phía sau */
.home .the { padding: 12px; }
.home .the .btn { margin: 6px 0; }
.home .the .btn.big { min-height: 64px; }
.home .the .song { font-size: 13px; }
.home .bon button { min-height: 54px; }
.home .the .link { margin-top: 4px; }
