:root { --c: #9D4EDD; --c2: #FFD166; --bg: #140B24; --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; }
/* ===== Số Kiếp ===== */
.home { padding-top: calc(var(--sat) + 60px); gap: 10px; }
.logo h1 { color: #fff3d6; text-shadow: 0 3px 0 #5a189a, 0 10px 30px rgba(20,8,40,.6); font-size: clamp(46px, 13vw, 66px); }
.logo p { color: #ffe9c4; text-shadow: 0 2px 10px rgba(20,8,40,.7); }
.spacer { width: 100%; height: clamp(150px, 30vh, 280px); cursor: pointer; }
.btn { background: linear-gradient(180deg, #fffaf0, #f3e6ff); color: #3a1a5a; padding: 8px 14px; }
.btn small { display: block; font-size: 13px; font-weight: 700; opacity: .75; margin-top: 2px; }
.btn.main { background: linear-gradient(180deg, #c77dff, #7b2cbf); color: #fff; border: 2px solid #ffd166; }
.btn.big { min-height: 78px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.link { background: rgba(255,250,240,.92); color: #3a1a5a; min-height: 48px; }
.link small { display: block; font-size: 12px; font-weight: 700; opacity: .7; }
.panel { background: #fffaf0; color: #2a1a3a; border: 3px solid #c77dff; }
.panel h2 { color: #5a189a; }
.panel h3 { color: #5a189a; margin: 16px 0 6px; }
.panel .small, .small { font-size: 13px; opacity: .8; margin: 2px 0; }
.panel b { color: #2a1a3a; }
.btn.sc { text-align: left; padding: 10px 14px; }
.btn.sc b { display: block; }
.btn.sc .st { float: right; color: #c48a12; letter-spacing: 2px; }
.btn.sc.lock { opacity: .5; }
.row { border-bottom: 1px dashed rgba(123,44,191,.3); padding: 9px 2px; }
.row b { display: block; }
.row em { font-style: normal; color: #c48a12; font-size: 13px; }
.row span { display: block; font-size: 13px; font-weight: 800; color: #7b2cbf; }
.row small { display: block; font-size: 13px; color: #5a4a6a; line-height: 1.45; }
.row.off { opacity: .55; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.tab { border: 2px solid #c77dff; background: #fff; border-radius: 12px; padding: 8px 10px; font-weight: 800; min-height: 44px; flex: 1 1 auto; }
.tab.on { background: #7b2cbf; color: #fff; }
.book { background: linear-gradient(180deg, #fffaf0, #f6ead2); border-color: #c9a227; }
.book h2 { font-size: 28px; margin: 2px 0 4px; }
.book .meta { color: #7b2cbf; font-weight: 800; font-size: 14px; }
.book p { color: #3a2a4a; }
.nho { background: #3a1a5a; color: #fff3d6; border-radius: 16px; padding: 12px 14px; font-weight: 700; line-height: 1.5; margin: 12px 0; }
.nho small { display: block; color: #ffd166; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.fate { display: flex; gap: 12px; align-items: center; background: #fff; border: 2px solid #c9a227; border-radius: 16px; padding: 10px 12px; margin: 10px 0; }
.fate .ic { font-size: 44px; }
.fate small { display: block; color: #c48a12; font-weight: 800; font-size: 12px; }
.fate b { display: block; font-size: 18px; }
.fate span { display: block; font-size: 13px; color: #5a4a6a; line-height: 1.4; }
.wish { font-weight: 800; color: #7a5a8a; }
.wish.ok { color: #2e7d32; }
.parts { list-style: none; padding: 0; margin: 0; }
.parts li { display: flex; justify-content: space-between; border-bottom: 1px dotted rgba(0,0,0,.15); padding: 5px 0; font-size: 14px; }
.parts li b { color: #7b2cbf; }
.kvs { display: grid; gap: 8px; margin-bottom: 8px; }
.kvb { display: flex; gap: 10px; align-items: center; text-align: left; background: #fff; border: 2px solid #e2d4f0; border-radius: 16px; padding: 10px 12px; min-height: 60px; }
.kvb .ic { font-size: 32px; }
.kvb b { display: block; }
.kvb small { display: block; font-size: 12px; color: #6a5a7a; font-weight: 700; }
.kvb.on { border-color: #c9a227; background: #fff6d8; box-shadow: 0 0 0 3px rgba(255,209,102,.5); }
