:root { --c: #BC6C25; --c2: #DDA15E; --bg: #1F140A; --ink: #3b2614; --mut: #7a5a3a; --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) + 60px) 16px 24px; max-width: 520px; margin: 0 auto; }
.logo { text-align: center; color: #fff3d6; text-shadow: 0 4px 18px rgba(0,0,0,.5); }
.logo h1 { margin: 0; font-size: clamp(42px, 12vw, 62px); font-weight: 900; letter-spacing: -1px; line-height: 1; }
.logo p { margin: 6px 0 0; font-weight: 800; font-size: 16px; color: #f2c94c; }
.spacer { height: max(150px, calc(42vh - 150px)); width: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: pointer; }
.spacer .hint { margin-bottom: 8px; background: rgba(0,0,0,.35); color: #ffe8c0; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 800; }
.sheet { width: 100%; background: rgba(255,246,228,.97); border-radius: 26px; padding: 14px; box-shadow: 0 -6px 30px rgba(0,0,0,.3); 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, #e8a04a, #b8571c); color: #fff; box-shadow: 0 8px 20px rgba(184,87,28,.4); }
.btn.big { min-height: 78px; font-size: 26px; font-weight: 900; }
.btn small { display: block; font-size: 14px; font-weight: 700; opacity: .95; }
.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: 104px; 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, #fff3cf, #ffdf98); }
.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: #fbf1dc; }
.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); }
.mut { color: var(--mut); font-size: 14px; margin: 4px 0 12px; font-weight: 600; line-height: 1.45; }
.list { display: flex; flex-direction: column; gap: 8px; }
.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: 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: 16.5px; }
.row small { color: var(--mut); font-weight: 600; font-size: 13px; line-height: 1.4; }
.row em { font-style: normal; font-weight: 900; color: #c45a1c; font-size: 17px; flex: none; }
.row.lock { opacity: .6; }
.yr { font-size: 12px; font-weight: 800; color: #fff; background: #a8702c; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.mini { width: 64px; height: 64px; border-radius: 14px; flex: none; background: radial-gradient(circle at 50% 40%, #fff8e8, #f0dfbc); }
.tabs { display: flex; gap: 6px; margin: 4px 0 8px; }
.tab { flex: 1; border: 0; border-radius: 14px; min-height: 52px; background: #fff; font-weight: 800; font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 3px 10px rgba(80,40,10,.08); }
.tab small { font-size: 12px; color: var(--mut); }
.tab.on { background: linear-gradient(180deg, #e8a04a, #b8571c); color: #fff; }
.tab.on small { color: #fff; }

#dlg { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: none; padding: 0 12px calc(var(--sab) + 12px); }
#dlg.on { display: block; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
#dlg .box { max-width: 560px; margin: 0 auto; background: #fff8e8; border: 3px solid #a8702c; border-radius: 22px; padding: 14px 16px; box-shadow: 0 -8px 30px rgba(0,0,0,.35); }
#dlg .nm { display: block; font-size: 17px; font-weight: 900; color: #a8572c; }
#dlg p { margin: 6px 0 10px; font-weight: 600; font-size: 16px; line-height: 1.5; color: var(--ink); }
#dlg p.new { color: #2f8f4f; font-weight: 800; margin-top: -4px; }
#dlg .opts { display: flex; flex-direction: column; gap: 8px; }
#dlg .opts button { border: 0; border-radius: 14px; min-height: 48px; padding: 8px 14px; font-weight: 800; font-size: 16px; background: #fff; box-shadow: 0 3px 10px rgba(80,40,10,.12); text-align: left; }
#dlg .opts button.main { background: linear-gradient(180deg, #e8a04a, #b8571c); color: #fff; }
