:root { --bg1: #2b1d12; --bg2: #4a3220; --accent: #f5c542; --accent2: #e08a1e; --card: rgba(255,255,255,.07); --text: #fff7e6; --muted: rgba(255,247,230,.62); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font-family: Vazirmatn, Tahoma, system-ui, sans-serif; color: var(--text); background: radial-gradient(120% 70% at 50% 25%, var(--bg2), var(--bg1)); user-select: none; -webkit-user-select: none; }
#app { height: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 10px) 14px calc(env(safe-area-inset-bottom) + 10px); }
.top { text-align: center; position: relative; }
.balance { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 40px; font-weight: 900; letter-spacing: .5px; }
.balance b { font-variant-numeric: tabular-nums; }
.rates { display: flex; justify-content: center; gap: 10px; margin-top: 4px; font-size: 13px; color: var(--muted); font-weight: 700; }
.rates span { background: var(--card); border-radius: 999px; padding: 4px 10px; }
.mine { position: relative; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; padding: 14px 0 8px; }
.tap { width: min(58vw, 230px); aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; background: radial-gradient(circle at 35% 30%, #8a6a4a, #4b3523 70%); box-shadow: 0 10px 0 #2a1a0e, 0 0 0 6px rgba(245,197,66,.18), 0 0 40px rgba(245,197,66,.25); display: grid; place-items: center; touch-action: manipulation; transition: transform .06s; }
.tap span { font-size: min(30vw, 120px); line-height: 1; filter: drop-shadow(0 6px 6px rgba(0,0,0,.4)); pointer-events: none; }
.tap.hit { transform: translateY(4px) scale(.97); box-shadow: 0 6px 0 #2a1a0e, 0 0 0 6px rgba(245,197,66,.3), 0 0 50px rgba(245,197,66,.4); }
.hint { margin-top: 10px; font-size: 13px; color: var(--muted); font-weight: 700; }
#floats { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.float { position: absolute; font-weight: 900; font-size: 20px; color: var(--accent); text-shadow: 0 2px 0 rgba(0,0,0,.45); animation: rise .9s ease-out forwards; white-space: nowrap; }
@keyframes rise { from { transform: translate(-50%, 0) scale(1); opacity: 1; } to { transform: translate(-50%, -90px) scale(1.2); opacity: 0; } }
.panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.panel h2 { margin: 6px 4px 8px; font-size: 16px; font-weight: 900; }
#upgrades { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-bottom: 6px; }
.up { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 16px; padding: 10px 12px; border: 0; color: inherit; font: inherit; text-align: right; cursor: pointer; width: 100%; }
.up .ic { font-size: 30px; width: 40px; text-align: center; }
.up .info { flex: 1; min-width: 0; }
.up .name { font-weight: 900; font-size: 15px; }
.up .desc { font-size: 12px; color: var(--muted); font-weight: 700; }
.up .lvl { font-size: 11px; color: var(--muted); }
.up .price { font-weight: 900; font-size: 14px; background: linear-gradient(var(--accent), var(--accent2)); color: #2b1d12; border-radius: 12px; padding: 8px 10px; white-space: nowrap; }
.up:disabled { cursor: default; }
.up:disabled .price { background: rgba(255,255,255,.12); color: var(--muted); }
.bar { display: flex; gap: 8px; padding-top: 8px; }
.action { flex: 1; border: 0; border-radius: 16px; padding: 12px 6px; font: inherit; font-weight: 900; font-size: 13px; color: #2b1d12; cursor: pointer; line-height: 1.25; }
.action small { display: block; font-size: 11px; font-weight: 700; opacity: .8; }
.ad { background: linear-gradient(#8ee07a, #3fae3a); }
.invite { background: linear-gradient(var(--accent), var(--accent2)); }
.board { background: linear-gradient(#a9d6ff, #4d9be6); }
.action:disabled { filter: grayscale(.7); opacity: .6; }
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet.show { display: flex; }
.sheet-body { width: 100%; max-width: 520px; max-height: 80vh; overflow-y: auto; background: var(--bg2); border-radius: 22px 22px 0 0; padding: 18px 16px calc(env(safe-area-inset-bottom) + 16px); animation: up .25s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h3 { margin: 0 0 10px; font-size: 18px; font-weight: 900; }
.sheet p { margin: 6px 0; color: var(--muted); font-weight: 700; font-size: 14px; }
.sheet .big { font-size: 30px; font-weight: 900; color: var(--accent); text-align: center; margin: 10px 0; }
.sheet .btn { width: 100%; border: 0; border-radius: 14px; padding: 12px; font: inherit; font-weight: 900; font-size: 16px; color: #2b1d12; background: linear-gradient(var(--accent), var(--accent2)); cursor: pointer; margin-top: 8px; }
.sheet .btn.alt { background: var(--card); color: var(--text); }
.rank { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; font-weight: 700; font-size: 14px; }
.rank:nth-child(odd) { background: var(--card); }
.rank .n { width: 28px; text-align: center; font-weight: 900; color: var(--muted); }
.rank .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank.me { outline: 2px solid var(--accent); }
.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 14px); transform: translate(-50%, -20px); background: rgba(0,0,0,.8); padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; z-index: 20; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.note { position: fixed; left: 0; right: 0; bottom: 0; text-align: center; font-size: 11px; color: var(--muted); padding: 2px; display: none; }
.note.show { display: block; }

.corner { position: absolute; top: 2px; width: 46px; height: 46px; border-radius: 14px; border: 0; background: var(--card); color: var(--text); font-size: 24px; cursor: pointer; }
.c-left { left: 0; } .c-right { right: 0; }
.dot { position: absolute; top: 6px; left: 6px; width: 10px; height: 10px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 0 2px var(--bg1); display: none; }
.dot.on { display: block; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.35); } }
.boost { display: none; margin: 6px auto 0; width: max-content; font-size: 13px; font-weight: 900; color: #2b1d12; background: linear-gradient(#ffe27a, #ffb02e); border-radius: 999px; padding: 3px 12px; }
.boost.on { display: block; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 12px 0; }
.dayc { background: var(--card); border-radius: 12px; padding: 8px 2px; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.dayc b { display: block; font-size: 12px; color: var(--text); margin-top: 3px; }
.dayc.done { background: rgba(120, 220, 120, .18); }
.dayc.today { outline: 2px solid var(--accent); color: var(--text); }
.prod { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 16px; padding: 10px 12px; margin-bottom: 8px; }
.prod .ic { font-size: 30px; width: 40px; text-align: center; }
.prod .info { flex: 1; min-width: 0; }
.prod .name { font-weight: 900; font-size: 15px; }
.prod .desc { font-size: 12px; color: var(--muted); font-weight: 700; }
.prod button { border: 0; border-radius: 12px; padding: 9px 12px; font: inherit; font-weight: 900; font-size: 14px; color: #2b1d12; background: linear-gradient(#ffe27a, #ffb02e); cursor: pointer; white-space: nowrap; }
.prod button:disabled { background: rgba(255,255,255,.12); color: var(--muted); }
