:root { --c: #E07A5F; --c2: #F2CC8F; --bg: #a86e3e; --ink: #3a2418; --mut: #7a5f48; --ok: #2f8f4f; --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(--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) + 62px) 16px 24px; max-width: 520px; margin: 0 auto; }
.logo { text-align: center; color: #6b2e1c; background: rgba(255,248,236,.9); border-radius: 24px; padding: 12px 22px 12px; box-shadow: 0 8px 24px rgba(80,40,10,.15); }
.logo h1 { margin: 0; font-size: clamp(42px, 12vw, 60px); font-weight: 900; letter-spacing: -1px; line-height: 1; }
.logo p { margin: 6px 0 0; font-weight: 800; font-size: 16px; }
.spacer { height: max(220px, calc(52vh - 170px)); width: 100%; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; }
.pethint { background: rgba(255,255,255,.8); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 800; color: var(--mut); }
.sheet { width: 100%; background: rgba(255,248,236,.97); border-radius: 26px; padding: 14px; box-shadow: 0 -6px 30px rgba(80,40,10,.22); 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, #f39a7d, var(--c)); color: #fff; box-shadow: 0 8px 20px rgba(224,122,95,.4); }
.btn.big { min-height: 78px; 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: 16.5px; }
.tile small { color: var(--mut); font-weight: 700; font-size: 12.5px; line-height: 1.3; }
.tile.hot { background: linear-gradient(180deg, #fff6d6, #ffe2b0); }
.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); }

/* tấm dưới trong lượt */
#sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: none; max-height: 41vh; overflow-y: auto; -webkit-overflow-scrolling: touch; background: rgba(255,248,236,.98); border-radius: 24px 24px 0 0; box-shadow: 0 -8px 30px rgba(60,30,10,.25); padding: 12px 14px calc(14px + var(--sab)); }
#sheet.on { display: block; }
.sh { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.ttl { display: flex; align-items: baseline; gap: 10px; }
.ttl b { font-size: 21px; font-weight: 900; }
.ttl span { color: var(--mut); font-weight: 700; font-size: 13.5px; flex: 1; }
.ttl .x { border: 0; background: #fff; border-radius: 12px; min-height: 44px; padding: 0 12px; font-weight: 800; box-shadow: 0 2px 8px rgba(80,40,10,.1); }
.lead { margin: 0; font-weight: 600; line-height: 1.45; font-size: 15px; }
.new { margin: 0; font-weight: 800; color: #b5523b; }
.mut { color: var(--mut); font-size: 14px; margin: 2px 0; font-weight: 600; line-height: 1.45; }
.say { background: #fff; border-radius: 18px; padding: 10px 14px; font-weight: 800; font-size: 17px; line-height: 1.4; box-shadow: 0 2px 10px rgba(80,40,10,.08); }
.cues { display: flex; flex-wrap: wrap; gap: 6px; }
.cues span { background: #fff1d6; border-radius: 12px; padding: 6px 10px; font-weight: 700; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { background: #fff; border-radius: 12px; padding: 6px 10px; font-weight: 700; font-size: 14px; }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.act { border: 0; background: #fff; border-radius: 16px; padding: 8px 10px; text-align: left; min-height: 64px; box-shadow: 0 3px 10px rgba(80,40,10,.1); display: grid; grid-template-columns: 30px 1fr; column-gap: 6px; align-items: center; }
.act i { font-style: normal; font-size: 24px; grid-row: span 2; }
.act b { font-size: 15px; }
.act small { color: var(--mut); font-weight: 600; font-size: 11.5px; line-height: 1.25; }
.act:disabled { opacity: .4; }
.act.yen { background: #eaf6e6; }
.act.goi-y { outline: 4px solid #ffb020; animation: nhay 1s ease-in-out infinite; }
@keyframes nhay { 50% { transform: scale(1.04); } }

/* trang phụ */
.page { max-width: 640px; margin: 0 auto; padding: calc(var(--sat) + 68px) 16px 40px; min-height: 100%; background: #fff8ec; }
.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); }
.row { border: 0; background: #fff; border-radius: 18px; padding: 10px 12px; display: flex; align-items: center; gap: 12px; text-align: left; box-shadow: 0 3px 12px rgba(80,40,10,.07); min-height: 56px; width: 100%; margin: 0 0 8px; }
.row > i { font-style: normal; font-size: 26px; width: 36px; text-align: center; flex: none; }
.row > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row b { font-size: 16px; }
.row small { color: var(--mut); font-weight: 600; font-size: 13px; line-height: 1.4; }
.row.ok { background: #effaf0; }
.row.lock { opacity: .6; }
.row:disabled { opacity: .55; }
.chap.lock { opacity: .7; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: -2px 0 12px; }
.day { border: 0; background: #fff; border-radius: 12px; min-height: 54px; padding: 4px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(80,40,10,.08); }
.day b { font-size: 17px; }
.day small { color: #e0a400; font-size: 10px; letter-spacing: 1px; }
.day:disabled { opacity: .45; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0 10px; }
.tabs button { border: 0; border-radius: 14px; min-height: 44px; background: #fff; font-weight: 800; font-size: 14px; box-shadow: 0 2px 8px rgba(80,40,10,.07); }
.tabs button.on { background: var(--c); color: #fff; }
.album { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.album figure { margin: 0; transform: rotate(-1.5deg); }
.album figure:nth-child(2n) { transform: rotate(1.5deg); }
.album img { width: 100%; display: block; border-radius: 6px; box-shadow: 0 6px 16px rgba(80,40,10,.2); }
.album figcaption { text-align: center; font-weight: 800; font-size: 13px; color: var(--mut); margin-top: 4px; }
.help { padding-left: 18px; }
.help li { margin-bottom: 10px; line-height: 1.5; font-weight: 600; }
