@font-face { font-family: Overpass; src: url(fonts/Overpass-var.ttf); font-weight: 100 900; font-display: swap; }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: #1d1611; overflow: hidden; overscroll-behavior: none; }
body { font-family: Overpass, ui-rounded, system-ui, sans-serif; color: #3b2a14; user-select: none; -webkit-user-select: none; touch-action: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
#app { position: relative; height: 100%; width: min(100vw, calc(100vh * 9 / 16)); margin: 0 auto; overflow: hidden; background: #3b2a14; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
.hide { display: none !important; }

#top { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.bars { display: flex; gap: 6px; }
.bar { width: 46px; background: rgba(255,255,255,.72); border-radius: 12px; padding: 4px 4px 5px; text-align: center; font-size: 18px; line-height: 1.1; box-shadow: 0 2px 0 rgba(0,0,0,.12); transition: transform .2s; }
.bar.low { animation: goyang .6s infinite; background: #ffe0d6; }
.bar i { display: block; height: 6px; border-radius: 3px; background: rgba(0,0,0,.12); margin-top: 3px; overflow: hidden; }
.bar i b { display: block; height: 100%; border-radius: 3px; width: 50%; transition: width .4s; }
.bar[data-k=lapar] b { background: #f39a2b; } .bar[data-k=bersih] b { background: #4bb3e8; } .bar[data-k=energi] b { background: #8a6be0; } .bar[data-k=senang] b { background: #5cc55c; }
@keyframes goyang { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.pill { background: #3b2a14; color: #ffd34d; font-weight: 800; border-radius: 20px; padding: 6px 11px; font-size: 15px; box-shadow: 0 2px 0 rgba(0,0,0,.25); white-space: nowrap; }
.pill.kecil { font-size: 12px; padding: 4px 9px; background: rgba(255,255,255,.9); color: #7a4a12; }
#sub { position: absolute; top: calc(66px + env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; justify-content: space-between; }
#jajan { background: #fff3c4; }

.bub { position: absolute; left: 16px; top: calc(102px + env(safe-area-inset-top)); max-width: 72%; background: #fff; border-radius: 16px; padding: 9px 12px; font-size: 14px; line-height: 1.3; box-shadow: 0 3px 0 rgba(0,0,0,.15); animation: muncul .3s ease-out; }
.bub small { display: block; color: #a08a70; font-size: 11px; margin-bottom: 2px; font-weight: 700; }
.say { position: absolute; transform: translate(-50%, -100%); background: #fff; border-radius: 14px; padding: 6px 10px; font-size: 14px; font-weight: 700; white-space: nowrap; box-shadow: 0 3px 0 rgba(0,0,0,.15); pointer-events: none !important; }
.say:after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; }
@keyframes muncul { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

#aksi { position: absolute; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 10px; padding: 0 12px; }
.btn { background: #ffd34d; color: #3b2a14; font-weight: 800; border-radius: 22px; padding: 11px 18px; font-size: 16px; box-shadow: 0 4px 0 #b8901f; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b8901f; }
.btn.biru { background: #7fd0f5; box-shadow: 0 4px 0 #3a93bf; }
.btn.abu { background: #eee; box-shadow: 0 4px 0 #aaa; }
.tray { display: flex; gap: 8px; background: rgba(59,42,20,.88); border-radius: 18px; padding: 8px; width: 100%; justify-content: center; }
.it { width: 23%; max-width: 78px; aspect-ratio: .9; background: rgba(255,255,255,.14); border-radius: 13px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 30px; touch-action: none; }
.it small { font-size: 10px; line-height: 1.15; text-align: center; margin-top: 2px; }
.it em { font-style: normal; font-size: 11px; color: #ffd34d; font-weight: 800; }
.it.punya { outline: 2px solid #5cc55c; }
.it.pakai { background: #ffd34d55; outline: 2px solid #ffd34d; }
.it svg { width: 36px; height: 30px; }
.ghost { position: absolute; font-size: 46px; transform: translate(-50%, -60%); pointer-events: none; z-index: 5; transition: transform .25s, opacity .25s; }

#nav { position: absolute; left: 0; right: 0; bottom: 0; padding-bottom: env(safe-area-inset-bottom); height: calc(70px + env(safe-area-inset-bottom)); background: #3b2a14; display: flex; justify-content: space-around; align-items: center; }
#nav button { width: 58px; height: 54px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #f4e3c8; font-size: 10px; font-weight: 700; }
#nav button span { font-size: 23px; line-height: 1.1; }
#nav button.on { background: #ffd34d; color: #3b2a14; }

#mg .mgtop { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 54px; display: flex; gap: 6px; justify-content: space-between; }
#mgx { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; width: 38px; text-align: center; padding: 6px 0; }
#mgjudul { position: absolute; top: calc(60px + env(safe-area-inset-top)); left: 0; right: 0; text-align: center; color: #ffd34d; font-weight: 900; font-size: 22px; text-shadow: 0 2px 0 #000; pointer-events: none; }
#mgtip { position: absolute; top: 40%; left: 30px; right: 30px; text-align: center; color: #fff; font-weight: 800; font-size: 17px; text-shadow: 0 2px 4px #000; pointer-events: none; }

#modal { position: absolute; inset: 0; background: rgba(20,12,4,.6); display: flex; align-items: center; justify-content: center; padding: 22px; z-index: 10; }
.card { background: #fffaf0; border-radius: 22px; padding: 22px 20px; width: 100%; max-width: 330px; text-align: center; animation: muncul .25s; }
.card h2 { font-size: 22px; margin-bottom: 8px; }
.card p { font-size: 15px; line-height: 1.45; margin-bottom: 14px; color: #5a4128; }
.card .besar { font-size: 44px; font-weight: 900; color: #e09a12; margin: 4px 0 10px; }
.card .row { display: flex; flex-direction: column; gap: 10px; }
.card small { display: block; color: #a08a70; font-size: 11px; margin-top: 10px; }

#toast { position: absolute; left: 50%; top: 21%; transform: translateX(-50%); background: rgba(30,20,10,.88); color: #fff; padding: 10px 16px; border-radius: 16px; font-size: 14px; font-weight: 700; text-align: center; max-width: 80%; z-index: 11; animation: muncul .2s; pointer-events: none; }

#loading { position: absolute; inset: 0; background: #3b2a14; color: #ffd34d; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; z-index: 20; transition: opacity .4s; }
#loading .logo { font-size: 26px; font-weight: 800; text-align: center; line-height: 1; color: #f4e3c8; }
#loading .logo b { font-size: 58px; color: #ffd34d; }
#loading .ld { font-size: 14px; color: #f4e3c8; opacity: .8; }
