/* Milo — My Virtual Cat (KucingKu) */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root { --cream: #FFF6EA; --ink: #33291F; --sub: #8C7C6E; --orange: #F58A3D; --deep: #D9641E; --teal: #14A096; --pink: #F06E96; --line: #F3E4D2; }
html, body { height: 100%; }
body { font-family: "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--cream); color: var(--ink); }
#app { max-width: 430px; margin: 0 auto; min-height: 100%; padding: 14px 16px 96px; position: relative; }
header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.title { font-weight: 800; font-size: 19px; }
.chips { display: flex; gap: 6px; align-items: center; }
.chip { background: #FFF0D6; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; font-weight: 700; font-size: 13px; }
.chip.streak { background: #FFE8DE; }
.iconbtn { border: 1px solid var(--line); background: #fff; border-radius: 999px; width: 34px; height: 34px; font-size: 14px; font-weight: 700; cursor: pointer; }
.tab { display: none; }
.tab.active { display: block; }
h2 { font-size: 19px; margin: 14px 0 10px; }
h3 { font-size: 15px; margin: 18px 0 8px; }
.hint { color: var(--sub); font-size: 12.5px; margin-top: 10px; line-height: 1.45; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; }

/* Pet area */
#petArea { position: relative; margin-top: 12px; border-radius: 22px; overflow: hidden; background: #FFF1DC; border: 1px solid var(--line); height: 320px; }
#petImg, #sceneImg { width: 100%; height: 100%; object-fit: cover; display: block; }
#petImg { animation: breathe 3.2s ease-in-out infinite; cursor: pointer; transform-origin: 50% 90%; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.018); } }
#petImg.bounce { animation: bounce .5s ease; }
@keyframes bounce { 0% { transform: translateY(0); } 35% { transform: translateY(-16px); } 70% { transform: translateY(2px); } 100% { transform: translateY(0); } }
#speech { position: absolute; left: 12px; bottom: 12px; background: rgba(30, 22, 16, .55); color: #fff; font-weight: 700; font-size: 13px; padding: 7px 12px; border-radius: 999px; max-width: 85%; }
#zzz { position: absolute; top: 14px; right: 16px; font-size: 30px; animation: floatz 2s ease-in-out infinite; }
@keyframes floatz { 0%, 100% { transform: translateY(0); opacity: .8; } 50% { transform: translateY(-8px); opacity: 1; } }
#hearts { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.heart { position: absolute; font-size: 22px; animation: rise 1.1s ease-out forwards; }
@keyframes rise { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-90px); opacity: 0; } }

/* Bars */
.bars { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 8px; }
.bar-label { width: 86px; font-size: 13px; font-weight: 700; }
.bar { flex: 1; height: 12px; background: #F6E9D8; border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 999px; transition: width .5s ease; }
.fill.food { background: var(--orange); } .fill.happy { background: var(--pink); } .fill.energy { background: var(--teal); }
.bar-val { width: 38px; text-align: right; font-size: 12px; color: var(--sub); font-weight: 700; }
.bar.grow { height: 12px; margin-top: 8px; }

.big-btn { width: 100%; border: none; border-radius: 16px; padding: 16px; font-size: 16px; font-weight: 800; color: #fff; cursor: pointer; margin-top: 12px; letter-spacing: .4px; }
.big-btn.orange { background: var(--orange); } .big-btn.teal { background: var(--teal); }
.big-btn:active { transform: scale(.985); }
.mini-btn { border: none; background: var(--orange); color: #fff; font-weight: 800; border-radius: 999px; padding: 8px 14px; cursor: pointer; font-size: 13px; }
.mini-btn:disabled { background: #D8C9B8; }

/* Food */
#foodGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.food-item { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 4px; text-align: center; cursor: pointer; }
.food-item:active { transform: scale(.96); }
.food-item .em { font-size: 30px; }
.food-item .nm { font-weight: 700; font-size: 12px; margin-top: 4px; }
.food-item .pr { color: var(--sub); font-size: 11px; }
.food-item.locked { opacity: .45; }
.ad-card { margin-top: 14px; display: flex; gap: 10px; align-items: center; background: #1B2642; color: #fff; border: none; }
.ad-icon { font-size: 26px; }
.ad-text { flex: 1; display: flex; flex-direction: column; }
.ad-text span { color: #C8D0E6; font-size: 12px; }

/* Play */
#playField { position: relative; height: 300px; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
#playField .big-btn { width: auto; padding: 14px 26px; margin: 0; }
#yarn { position: absolute; font-size: 54px; cursor: pointer; user-select: none; transition: left .18s, top .18s; }
#playInfo { margin-top: 12px; text-align: center; font-size: 15px; }

/* Profile */
.profile-card { display: flex; gap: 12px; align-items: center; }
.profile-img { width: 92px; height: 92px; border-radius: 16px; object-fit: cover; }
.profile-name { font-size: 19px; font-weight: 800; }
.profile-stage { color: var(--sub); font-size: 13px; margin-top: 2px; }
.profile-card > div { flex: 1; }
.profile-next { color: var(--sub); font-size: 11.5px; margin-top: 4px; }
#stageRow, #streakRow { display: flex; gap: 8px; }
.stage-chip { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 2px; text-align: center; font-size: 12px; font-weight: 700; color: var(--sub); }
.stage-chip .em { font-size: 24px; display: block; }
.stage-chip.done { background: #FFF0D6; border-color: var(--orange); color: var(--ink); }
.day-chip { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--sub); }
.day-chip.on { background: #FFE8DE; color: var(--ink); }
.settings { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.set-row { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px; }

/* Nav */
#bottomNav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 20; }
#bottomNav button { flex: 1; border: none; background: none; padding: 9px 0 12px; font-size: 19px; display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--sub); cursor: pointer; }
#bottomNav button span { font-size: 10.5px; font-weight: 700; }
#bottomNav button.active { color: var(--deep); }

#toast { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); background: #33291F; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 700; z-index: 40; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
#adOverlay { position: fixed; inset: 0; background: rgba(15, 12, 10, .82); z-index: 50; display: flex; align-items: center; justify-content: center; }
[hidden] { display: none !important; }
.ad-box { background: #1B2642; color: #fff; border-radius: 20px; padding: 34px 44px; text-align: center; }
.ad-sim { font-size: 17px; font-weight: 800; }
#adTimer { font-size: 40px; font-weight: 800; margin-top: 8px; }
.set-row.credits span { font-size: 10.5px; color: var(--sub); font-weight: 400; line-height: 1.4; }
