/* ---------- v3.1 additions: meta screens, rewards, banners ---------- */
.home-top { position: absolute; top: calc(env(safe-area-inset-top) + 12px); left: 14px; right: 14px; display: flex; justify-content: space-between; z-index: 2; }
.pill { display: flex; align-items: center; gap: 6px; font: 900 18px/1 var(--font); background: rgba(40,15,0,.45); padding: 7px 14px; border-radius: 20px; box-shadow: inset 0 2px 4px rgba(0,0,0,.35); }
.pill.small { font-size: 15px; padding: 6px 10px; }
.flame-pill span:first-child { animation: flick 1.2s ease-in-out infinite; display: inline-block; }
@keyframes flick { 0%,100% { transform: scale(1) rotate(-4deg) } 50% { transform: scale(1.15) rotate(4deg) } }
.home-inner { gap: 14px; }
.home-buttons { gap: 16px; }
.btn.big.done { filter: saturate(.75); }
#btnDaily { font-size: 20px; padding-left: 52px; }
#btnAdventure.badge::after { content: "🎁"; position: absolute; right: -6px; top: -12px; font-size: 26px; animation: bob 1s ease-in-out infinite; }
.btn.round em { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); font: 900 10px/1 var(--font); font-style: normal; background: #6e3d1b; padding: 3px 6px; border-radius: 8px; white-space: nowrap; }
.home-small { gap: 14px; }
.hud-right { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.hud-coins { display: flex; align-items: center; gap: 4px; font: 900 14px/1 var(--font); background: rgba(40,15,0,.35); padding: 5px 9px; border-radius: 12px; transition: transform .12s; }
.hud-coins.bump { transform: scale(1.2); }
.hud-best { position: relative; }
.hud-best.near { background: conic-gradient(#ffcc1a var(--p, 0%), rgba(40,15,0,.35) 0); animation: pulse .6s ease-in-out infinite; }
.goal.limit { background: rgba(10,40,80,.5); }
.goal.warn { background: rgba(170,20,20,.75); animation: pulse .5s ease-in-out infinite; }
.modal-card h2.boss { background: linear-gradient(180deg,#ff5a4a,#a01010); box-shadow: inset 0 3px 0 rgba(255,255,255,.45), 0 5px 0 #5c0606; }
.hot { font-weight: 900 !important; color: #c0400a; }
.sad { font-weight: 900; color: #5a5a8a; }
.coins-line { font-weight: 900; color: #8a5a00; font-size: 18px; }
.reward-pop { font: 900 28px/1.2 var(--font); color: #d07a00; animation: popIn .4s cubic-bezier(.2,1.8,.4,1); }
.new-el { margin: 14px 0 8px; padding: 12px 10px 10px; border-radius: 16px; background: rgba(255,255,255,.55); position: relative; }
.new-el img { width: 56px; height: 56px; }
.new-el p { margin: 4px 0 0; font-size: 14px; }
.new-tag { position: absolute; top: -10px; left: 12px; background: #e0401e; color: #fff; font: 900 12px/1 var(--font); padding: 5px 8px; border-radius: 8px; transform: rotate(-6deg); }
.el-row { display: flex; justify-content: center; gap: 8px; margin: 8px 0; }
.el-row img { width: 40px; height: 40px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 12px 0 6px; }
.day { background: rgba(110,58,20,.15); border-radius: 10px; padding: 5px 0; font: 900 12px/1.2 var(--font); display: flex; flex-direction: column; align-items: center; }
.day small { font-size: 9px; opacity: .8; }
.day b { font-size: 16px; }
.day.got { background: rgba(60,160,60,.35); }
.day.today { background: linear-gradient(180deg,#ffe27a,#f0a020); box-shadow: 0 0 0 2px #fff, 0 0 12px #ffc040; color: #5a2a00; }
.chest { font-size: 86px; line-height: 1.1; margin: 6px 0; display: inline-block; filter: drop-shadow(0 6px 6px rgba(0,0,0,.3)); }
.chest.shake { animation: shake .12s linear infinite; }
.chest.open { animation: popIn .5s cubic-bezier(.2,1.8,.4,1); font-size: 60px; }
@keyframes shake { 0% { transform: rotate(-9deg) } 50% { transform: rotate(9deg) } 100% { transform: rotate(-9deg) } }
.ach-banner { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 10px); transform: translate(-50%, -160%); z-index: 30; display: flex; align-items: center; gap: 10px; min-width: 280px; max-width: 92vw;
  background: linear-gradient(180deg,#fff2c0,#f0b84a); color: #4a2508; border-radius: 18px; padding: 10px 16px; box-shadow: 0 0 0 4px #a8622a, 0 10px 24px rgba(0,0,0,.45); transition: transform .45s cubic-bezier(.2,1.5,.4,1); pointer-events: none; }
.ach-banner.show { transform: translate(-50%, 0); }
.ach-banner .trophy { font-size: 36px; animation: bob 1s ease-in-out infinite; }
.ach-banner small { display: block; font: 900 10px/1 var(--font); letter-spacing: 1.5px; color: #a0500a; }
.ach-banner b { display: block; font: 900 18px/1.2 var(--font); }
.ach-banner i { display: block; font: 700 12px/1.2 var(--font); font-style: normal; opacity: .85; }
.star-chest { margin: 0 12px 16px; display: flex; align-items: center; gap: 10px; background: rgba(40,15,0,.45); border-radius: 18px; padding: 10px 12px; }
.star-chest.ready { background: linear-gradient(180deg,#ffd36b,#e08a10); }
.sc-ico { font-size: 30px; }
.sc-mid { flex: 1; }
.sc-mid b { font: 900 13px/1.4 var(--font); letter-spacing: 1px; }
.btn.small-btn { padding: 8px 12px; font-size: 13px; border-radius: 12px; }
.ch-head { display: flex; align-items: center; gap: 12px; }
.ch-head h3 { text-align: left; flex: 1; }
canvas.art { width: 84px; height: 84px; border-radius: 12px; box-shadow: 0 0 0 3px rgba(255,255,255,.7), 0 4px 10px rgba(0,0,0,.4); image-rendering: pixelated; background: #7a4a26; transition: box-shadow .3s; }
canvas.art.glow { box-shadow: 0 0 0 4px #fff, 0 0 28px 8px #ffe27a; }
#pageBody { flex: 1; overflow-y: auto; touch-action: pan-y; padding: 6px 14px 40px; max-width: 520px; width: 100%; margin: 0 auto; }
.page-note { text-align: center; font-weight: 700; font-size: 14px; opacity: .9; margin: 6px 0 14px; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.theme-card { background: rgba(40,15,0,.4); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: inset 0 2px 4px rgba(0,0,0,.3); }
.theme-card.sel { box-shadow: 0 0 0 3px #7cf07a, inset 0 2px 4px rgba(0,0,0,.3); }
.theme-card img { width: 100%; max-width: 130px; border-radius: 12px; }
.theme-card b { font: 900 15px/1 var(--font); }
.theme-card .btn { width: 100%; }
.buy-prev { width: 120px; border-radius: 14px; margin: 6px auto; display: block; }
.ach { display: flex; align-items: center; gap: 10px; background: rgba(40,15,0,.4); border-radius: 16px; padding: 10px 12px; margin-bottom: 10px; }
.ach.got { background: linear-gradient(180deg, rgba(255,210,90,.55), rgba(200,120,20,.55)); }
.ach-ico { font-size: 28px; }
.ach-mid { flex: 1; min-width: 0; }
.ach-mid b { display: block; font: 900 15px/1.2 var(--font); }
.ach-mid small { display: block; font-weight: 700; font-size: 12px; opacity: .85; margin-bottom: 4px; }
.ach-rew { font: 900 13px/1 var(--font); color: #ffe27a; white-space: nowrap; }
.stats { background: rgba(40,15,0,.4); border-radius: 18px; padding: 6px 14px; }
.stat-row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px dashed rgba(255,255,255,.2); font-weight: 800; }
.stat-row:last-child { border-bottom: 0; }
.stat-row b { font-weight: 900; color: #ffe27a; }
.daily-top { text-align: center; margin: 4px 0 12px; }
.flame-big { font: 900 48px/1.1 var(--font); text-shadow: 0 3px 0 rgba(0,0,0,.3); }
.cal-card { background: rgba(40,15,0,.4); border-radius: 18px; padding: 12px; margin-bottom: 12px; }
.cal-card h4 { text-align: center; font: 900 16px/1 var(--font); letter-spacing: 2px; margin-bottom: 10px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-h { text-align: center; font: 900 11px/1 var(--font); opacity: .7; padding-bottom: 4px; }
.cal-d { aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.12); font: 900 14px/1 var(--font); }
.cal-d.done { background: linear-gradient(180deg,#8ee86a,#2fae3c); }
.cal-d.today { box-shadow: 0 0 0 3px #ffe27a; }
.cal-d.future { opacity: .35; }

/* ---- 1.0.1: daily quests, tool shop ---- */
#btnQuests.dot::after { content: ""; position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: #ff3d3d; box-shadow: 0 0 0 2px #fff; animation: pulse 1s ease-in-out infinite; }
#btnQuests { position: relative; }
.quests { display: flex; flex-direction: column; gap: 10px; }
.quest { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: rgba(0,0,0,.28); }
.quest.done { box-shadow: 0 0 0 2px #ffcc1a inset; }
.quest.claimed { opacity: .55; }
.quest .q-main { flex: 1; min-width: 0; }
.quest .q-main b { display: block; font-size: 15px; }
.quest .q-main small { font-size: 12px; opacity: .8; }
.q-bar { height: 10px; border-radius: 6px; background: rgba(255,255,255,.15); margin: 6px 0 3px; overflow: hidden; }
.q-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg,#ffe066,#ffaa1a); }
.q-rew { font-weight: 900; white-space: nowrap; }
.shop-h { margin: 14px 0 4px; font-size: 16px; letter-spacing: 1px; }
.shop-tools { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.shop-tool { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: rgba(0,0,0,.28); }
.shop-tool .st-ico { font-size: 28px; }
.shop-tool div { flex: 1; }
.shop-tool b { display: block; }
.shop-tool small { opacity: .8; font-size: 12px; }
.home-small { gap: 10px; flex-wrap: nowrap; justify-content: center; }
@media (max-width: 400px) { .home-small { gap: 6px; } .home-small .btn.round { width: 46px; height: 46px; font-size: 20px; } }
.ach-banner { transform: translate(-50%, calc(-100% - 80px)); }
.ach-banner.show { transform: translate(-50%, 0); }

/* ---- 1.0.2: undo/hint tools, Brain Score, setback ---- */
#toolbar { gap: 16px; }
.tool.paid b { background: #c98a00; font-size: 11px; }
.tool.paid.off { opacity: .45; }
.tool { font-weight: 900; color: #fff; }
.home-right { display: flex; gap: 8px; align-items: center; }
.brain-pill { border: 0; cursor: pointer; color: #fff; font-family: var(--font); font-weight: 900; font-size: 16px; }
.brain-hero { text-align: center; margin: 4px 0 10px; }
.brain-ico { font-size: 54px; line-height: 1; }
.brain-num { font: 900 64px/1 var(--font); color: #fff4c0; text-shadow: 0 3px 0 rgba(0,0,0,.35); }
.brain-sub { font-weight: 900; color: #b8ffb0; margin-top: 4px; }
.brain-chart { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding: 12px; border-radius: 16px; background: rgba(0,0,0,.28); margin-bottom: 10px; }
.brain-chart .bb { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.brain-chart .bb span { font: 900 11px/1 var(--font); opacity: .9; min-height: 11px; }
.brain-chart .bb i { width: 100%; max-width: 30px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg,#9be7ff,#3b9bff); }
.brain-chart .bb i.today { background: linear-gradient(180deg,#ffe066,#ff9f1a); }
.brain-chart .bb i.none { background: rgba(255,255,255,.15); }
.brain-chart .bb em { font: 800 10px/1 var(--font); font-style: normal; opacity: .8; }
.brain-rank { font: 900 16px/1.2 var(--font); color: #ffe066; letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; }
.brain-sub.down { color: #ffb0a0; }
.share-btn { margin: 2px auto 4px; }

/* 1.0.7: bomb / new-pieces counter on the home screen */
.home-left { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tool-pill { font-size: 15px; padding: 5px 12px; gap: 5px; }
.tool-pill .tp-sep { width: 1px; height: 14px; background: rgba(255,255,255,.3); margin: 0 3px; }
