:root { --c: #BC6C25; --c2: #DDA15E; --bg: #0d1330; --ink: #3a2412; --mut: #7a5f48; --paper: #fff8ec; --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; padding: calc(var(--sat) + 66px) 16px 24px; max-width: 520px; margin: 0 auto; }
.logo { text-align: center; color: #fff; text-shadow: 0 3px 16px rgba(0,0,0,.5); }
.logo .mark { width: 72px; height: 72px; margin: 0 auto 6px; border-radius: 22px; display: grid; place-items: center; font-size: 40px; background: linear-gradient(135deg, #ffcf6b, var(--c)); box-shadow: 0 0 30px rgba(255,190,90,.55); transform: rotate(-6deg); }
.logo h1 { margin: 0; font-size: clamp(40px, 11vw, 56px); font-weight: 900; letter-spacing: -1px; line-height: 1; color: #fff3b0; }
.logo p { margin: 6px 0 0; font-weight: 800; font-size: 16px; color: #ffe0b2; }
.spacer { height: max(230px, calc(44vh - 140px)); width: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: pointer; }
.pethint { margin-bottom: 8px; background: rgba(13,19,48,.72); color: #ffe0b2; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 800; text-align: center; }
.sheet { width: 100%; background: rgba(255,248,236,.97); border-radius: 26px; padding: 14px; box-shadow: 0 -6px 30px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 8px; }
.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 16px rgba(80,40,10,.14); }
.btn.main { background: linear-gradient(180deg, #ff9f43, #e65100); color: #fff; box-shadow: 0 8px 20px rgba(230,81,0,.4); }
.btn.big { min-height: 76px; font-size: 26px; font-weight: 900; }
.btn small { display: block; font-size: 14px; font-weight: 700; opacity: .92; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { border: 0; border-radius: 20px; background: #fff; padding: 12px; text-align: left; min-height: 100px; box-shadow: 0 4px 14px rgba(80,40,10,.1); display: flex; flex-direction: column; gap: 2px; }
.tile i { font-style: normal; font-size: 26px; }
.tile b { font-size: 17px; }
.tile small { color: var(--mut); font-weight: 700; font-size: 12.5px; line-height: 1.3; }
.tile.hot { background: linear-gradient(180deg, #fff6d6, #ffe7a8); }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tog { border: 2px solid #ead8bd; background: #fff; border-radius: 16px; min-height: 58px; padding: 8px 10px; font-weight: 900; font-size: 16px; text-align: left; }
.tog small { display: block; font-size: 12px; font-weight: 700; color: var(--mut); }
.tog.on { border-color: var(--c); background: #fff1d0; }
.link { border: 0; background: #fff; border-radius: 14px; min-height: 48px; padding: 10px 16px; font-weight: 800; width: 100%; box-shadow: 0 3px 10px rgba(80,40,10,.08); }
.foot { color: var(--mut); font-size: 13px; text-align: center; margin: 6px 0 0; }
.foot a { color: var(--c); }

.page { max-width: 640px; margin: 0 auto; padding: calc(var(--sat) + 68px) 16px 40px; min-height: 100%; background: var(--paper); }
.top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.top h2 { margin: 0; font-size: 24px; font-weight: 900; }
.back { border: 0; background: #fff; border-radius: 14px; min-height: 44px; padding: 0 14px; font-weight: 800; box-shadow: 0 3px 10px rgba(80,40,10,.1); flex: none; }
.mut { color: var(--mut); font-size: 14px; margin: 4px 0 12px; font-weight: 600; line-height: 1.5; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { border: 0; background: #fff; border-radius: 18px; padding: 12px; display: flex; align-items: center; gap: 12px; text-align: left; box-shadow: 0 3px 12px rgba(80,40,10,.07); min-height: 60px; width: 100%; }
.row > i { font-style: normal; font-size: 28px; width: 40px; text-align: center; flex: none; }
.row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row b { font-size: 17px; }
.row small { color: var(--mut); font-weight: 600; font-size: 13px; line-height: 1.35; }
.row span { font-weight: 600; line-height: 1.45; font-size: 14.5px; }
.row em { font-style: normal; font-weight: 900; color: #f2a900; letter-spacing: 2px; flex: none; }
.row.lock { opacity: .55; }
.bar { display: block; height: 9px; background: #f0e2cd; border-radius: 5px; overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffcf6b, #e65100); border-radius: 5px; }
.spark { width: 96px; height: 36px; flex: none; }
.sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 10px; }
.sum div { background: #fff; border-radius: 16px; padding: 10px 6px; text-align: center; box-shadow: 0 3px 10px rgba(80,40,10,.07); }
.sum b { display: block; font-size: 22px; font-weight: 900; color: var(--c); }
.sum small { font-size: 12px; font-weight: 700; color: var(--mut); }
.pill { display: block; background: #fff1d0; color: #8b4a12; font-weight: 800; border-radius: 14px; padding: 10px 14px; font-size: 14px; margin: 0 0 10px; }
.lvls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.lvl { border: 0; background: #fff; border-radius: 18px; padding: 12px; min-height: 112px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; box-shadow: 0 3px 12px rgba(80,40,10,.07); }
.lvl b { font-size: 28px; line-height: 1; }
.lvl span { font-weight: 900; font-size: 16px; }
.lvl small { color: var(--mut); font-weight: 700; font-size: 12.5px; line-height: 1.35; }
.lvl.lock { opacity: .5; }
.panel { background: var(--paper); 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 li { color: var(--ink); font-weight: 600; line-height: 1.5; margin-bottom: 6px; }

/* Chữ to — cho người lớn tuổi */
body.to .btn { font-size: 20px; } body.to .btn.big { font-size: 30px; } body.to .btn small, body.to .tog small { font-size: 15px; }
body.to .tile b, body.to .row b, body.to .lvl span { font-size: 20px; } body.to .tile small, body.to .row small, body.to .lvl small, body.to .mut { font-size: 16px; }
body.to .row span, body.to .panel li { font-size: 18px; } body.to .link, body.to .tog { font-size: 19px; } body.to .pethint { font-size: 16px; }
