:root { --c: #D7263D; --c2: #FFC94A; --bg: #1A1230; --ink: #3A2416; --mut: #7A5E48; --paper: #FFF7E8; --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; }
button:disabled { cursor: default; }
.home { min-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: calc(var(--sat) + 150px) 16px 32px; max-width: 520px; margin: 0 auto; }
/* tờ lịch bloc */
.lich { position: relative; width: 100%; background: linear-gradient(180deg, #FFFDF6, #F6E7CC); border-radius: 22px; padding: 0 16px 16px; text-align: center; box-shadow: 0 16px 40px rgba(0,0,0,.4), 0 4px 0 #E2CFA9, 0 8px 0 #CDB88F; overflow: visible; }
.lich .rings { position: absolute; top: -14px; left: 0; right: 0; display: flex; justify-content: space-around; padding: 0 22%; }
.lich .rings i { width: 14px; height: 30px; border-radius: 8px; background: linear-gradient(90deg, #8a8a9a, #e4e4ee, #8a8a9a); box-shadow: 0 2px 4px rgba(0,0,0,.4); }
.lich-head { margin: 0 -16px; padding: 18px 0 10px; background: var(--c); color: #fff; font-weight: 900; letter-spacing: 2px; border-radius: 22px 22px 0 0; font-size: 18px; }
.lich-so { font-size: clamp(96px, 30vw, 132px); font-weight: 900; line-height: 1; margin-top: 6px; color: #2A2A6A; letter-spacing: -4px; }
.lich-so.cn { color: var(--c); }
.lich-thu { font-size: 26px; font-weight: 900; text-transform: uppercase; }
.lich-am { color: var(--mut); font-weight: 700; font-size: 14.5px; margin-top: 4px; }
.lich-am b { color: var(--c); }
.lich-de { margin: 12px auto 8px; display: inline-block; background: #2A2A6A; color: #FFE07A; font-weight: 900; padding: 6px 14px; border-radius: 999px; font-size: 15px; letter-spacing: .5px; }
.lich-kinds { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.lich-kinds span { background: #fff; border: 1.5px solid #EAD7B5; border-radius: 12px; padding: 4px 9px; font-weight: 800; font-size: 13.5px; }
.lich-moi { margin-top: 10px; font-weight: 800; color: #9A3412; font-size: 14px; }
.btn { display: block; width: 100%; min-height: 52px; border: 0; border-radius: 18px; background: #fff; font-weight: 800; font-size: 17px; margin: 6px 0; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.btn.main { background: linear-gradient(180deg, #F0475B, var(--c)); color: #fff; box-shadow: 0 6px 0 #9E1B2C, 0 10px 24px rgba(0,0,0,.3); }
.btn.big { min-height: 76px; font-size: 23px; font-weight: 900; }
.btn small { display: block; font-size: 13px; font-weight: 700; opacity: .9; }
.btn.soft { background: linear-gradient(180deg, #FFF3C4, #FFD86B); color: #5A3A00; }
.link { border: 0; background: rgba(255,247,232,.92); border-radius: 14px; padding: 12px 10px; font-weight: 800; width: 100%; min-height: 50px; }
.link:disabled { opacity: .4; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.stats3 div { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 8px 4px; text-align: center; color: #fff; }
.stats3 b { display: block; font-size: 20px; font-weight: 900; color: #FFE07A; }
.stats3 span { font-size: 12px; font-weight: 700; opacity: .85; }
.donebox { display: flex; gap: 12px; align-items: center; width: 100%; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 18px; padding: 12px; color: #fff; }
.donebox b { display: block; font-size: 18px; }
.donebox span { font-size: 14px; opacity: .9; font-weight: 600; }
.donebox i { font-style: normal; color: #FFE07A; font-weight: 800; }
.medal { flex: 0 0 54px; height: 54px; border-radius: 50%; background: #776; box-shadow: inset 0 0 0 5px rgba(0,0,0,.15); }
.m3 .medal, .medal.m3, .dot.m3 { background: radial-gradient(circle at 35% 30%, #fff, #FFE07A 35%, #E0A21B); }
.medal.m2, .dot.m2 { background: radial-gradient(circle at 35% 30%, #fff, #E3E8EF 35%, #9AA5B4); }
.medal.m1, .dot.m1 { background: radial-gradient(circle at 35% 30%, #fff, #E8A87C 35%, #B5673A); }
.medal.m0 { background: radial-gradient(circle at 35% 30%, #fff, #D8CFC4 35%, #9C8E80); }
.panel { background: var(--paper); border-radius: 22px; padding: 20px; max-width: 480px; margin: calc(var(--sat) + 70px) auto 24px; width: calc(100% - 32px); box-shadow: 0 16px 40px rgba(0,0,0,.35); }
.panel.wide { max-width: 560px; }
.panel h2 { margin: 0 0 8px; }
.panel h3 { margin: 14px 0 4px; }
.panel p, .panel li { color: var(--mut); font-weight: 600; line-height: 1.5; }
.panel ul { padding-left: 20px; }
.panel li { margin: 5px 0; }
.panel li b, .panel p b { color: var(--ink); }
.foot { color: #fff; font-size: 13px; text-align: center; opacity: .85; }
.foot a { color: #fff; }
/* lịch tháng */
.calnav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin: 8px 0; }
.calnav b { font-size: 18px; }
.calnav .link { background: #F1E2C6; min-height: 44px; }
.calh, .cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calh span { text-align: center; font-weight: 800; color: var(--mut); font-size: 13px; }
.cd { position: relative; aspect-ratio: 1; border: 0; border-radius: 12px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; padding: 0; min-height: 44px; box-shadow: 0 2px 0 #E9D7B6; }
.cd.empty { background: transparent; box-shadow: none; }
.cd b { font-size: 15px; }
.cd i { width: 20px; height: 20px; border-radius: 50%; margin-top: 2px; }
.cd.m3 i { background: radial-gradient(circle at 35% 30%, #fff, #FFE07A 35%, #E0A21B); }
.cd.m2 i { background: radial-gradient(circle at 35% 30%, #fff, #E3E8EF 35%, #9AA5B4); }
.cd.m1 i { background: radial-gradient(circle at 35% 30%, #fff, #E8A87C 35%, #B5673A); }
.cd.m0 i { background: #CFC4B6; }
.cd em { font-style: normal; font-size: 10px; color: #2A9D8F; font-weight: 800; }
.cd.today { outline: 3px solid var(--c); }
.cd.off { opacity: .35; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle; }
.dot.ar { background: #2A9D8F; }
/* luyện */
.kinds { display: grid; gap: 10px; margin: 10px 0; }
.kind { background: #fff; border-radius: 16px; padding: 12px; box-shadow: 0 2px 0 #E9D7B6; }
.kt { display: flex; justify-content: space-between; align-items: baseline; }
.kt b { font-size: 17px; }
.kt span { font-size: 13px; color: var(--mut); font-weight: 700; }
.kind p { margin: 4px 0 8px; font-size: 13.5px; }
.lvs { display: flex; gap: 8px; }
.lv { flex: 1; border: 0; border-radius: 12px; min-height: 48px; background: linear-gradient(180deg, #FFE07A, #F4A300); font-weight: 900; color: #4A2A00; }
.lv small { display: block; font-size: 11px; font-weight: 700; }
.lv.lock { background: #EDE3D3; color: #9C8E80; }
