*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:'Nunito',sans-serif;
}

body{
    background:linear-gradient(180deg,#7fd4ff,#e9fbff);
    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
    padding:20px;
}

.background{
    position:fixed;
    inset:0;
    background:
        radial-gradient(circle at 20% 20%,rgba(255,255,255,.4),transparent 250px),
        radial-gradient(circle at 80% 10%,rgba(255,255,255,.25),transparent 200px);
    z-index:-1;
}

.game{
    width:430px;
    max-width:100%;
    background:white;
    border-radius:28px;
    padding:25px;
    box-shadow:0 20px 50px rgba(0,0,0,.15);
}

header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}

.logo{
    font-size:34px;
    font-weight:900;
    color:#ff9800;
}

.top{
    display:flex;
    gap:10px;
}

.coins,
.level{
    background:#fff3c4;
    padding:8px 14px;
    border-radius:14px;
    font-weight:bold;
}

.room{
    position:relative;
    height:230px;
    border-radius:22px;
    overflow:hidden;
    background:linear-gradient(#9ee7ff,#ffffff);
    border:4px solid #d8efff;
    margin-bottom:20px;
}

.sky{
    position:absolute;
    inset:0;
}

.ground{
    position:absolute;
    bottom:0;
    width:100%;
    height:70px;
    background:#86d96d;
}

.pet{
    position:absolute;
    left:50%;
    top:55%;
    transform:translate(-50%,-50%);
    font-size:110px;
    cursor:pointer;
    user-select:none;
    animation:float 2s ease-in-out infinite;
}

@keyframes float{

0%{transform:translate(-50%,-50%)}

50%{transform:translate(-50%,-58%)}

100%{transform:translate(-50%,-50%)}

}

.pet-info{
    text-align:center;
    margin-bottom:20px;
}

.pet-info input{
    width:70%;
    padding:10px;
    border:2px solid #ddd;
    border-radius:12px;
    font-size:16px;
}

.pet-info button{
    padding:10px 15px;
    border:none;
    background:#4caf50;
    color:white;
    border-radius:12px;
    cursor:pointer;
}

.pet-info h2{
    margin-top:15px;
}

.pet-info p{
    color:#777;
}

.stats{
    margin-top:20px;
}

.stat{
    margin:15px 0;
}

.label{
    display:flex;
    justify-content:space-between;
    font-weight:bold;
    margin-bottom:6px;
}

.bar{
    height:18px;
    background:#ececec;
    border-radius:30px;
    overflow:hidden;
}

.fill{
    width:100%;
    height:100%;
    transition:.3s;
}

#food{
    background:#ff9800;
}

#happy{
    background:#ff4db8;
}

#energy{
    background:#00c853;
}

#health{
    background:#ff4444;
}

.buttons{
    margin-top:25px;
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:15px;
}

.buttons button{
    border:none;
    border-radius:18px;
    padding:18px;
    font-size:18px;
    font-weight:bold;
    cursor:pointer;
    color:white;
    transition:.2s;
}

.buttons button:hover{
    transform:translateY(-4px);
}

#feed{
    background:#ff9800;
}

#play{
    background:#42a5f5;
}

#sleep{
    background:#7e57c2;
}

#shop{
    background:#43a047;
}

.inventory,
.quests{
    margin-top:25px;
    background:#fafafa;
    border-radius:20px;
    padding:18px;
}

.inventory h2,
.quests h2{
    margin-bottom:10px;
}

#inventoryItems{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.item{
    width:70px;
    height:70px;
    border-radius:16px;
    background:white;
    display:flex;
    justify-content:center;
    align-items:center;
    font-size:28px;
    cursor:pointer;
    box-shadow:0 5px 12px rgba(0,0,0,.08);
}

.empty{
    color:#777;
}

footer{
    margin-top:20px;
    text-align:center;
    color:#666;
}

.modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    display:flex;
    justify-content:center;
    align-items:center;
}

.hidden{
    display:none;
}

.modal-content{
    width:450px;
    max-width:95%;
    background:white;
    border-radius:24px;
    padding:25px;
}

.shop-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:15px;
    margin:20px 0;
}

.buy{
    border:none;
    border-radius:18px;
    background:#f5f5f5;
    padding:18px;
    cursor:pointer;
    transition:.2s;
    font-size:17px;
}

.buy:hover{
    background:#ffe082;
    transform:scale(1.03);
}

#closeShop{
    width:100%;
    border:none;
    border-radius:14px;
    padding:14px;
    background:#2196f3;
    color:white;
    cursor:pointer;
}

@media(max-width:600px){

.game{
    width:100%;
    border-radius:0;
    min-height:100vh;
}

.logo{
    font-size:28px;
}

.pet{
    font-size:90px;
}

.buttons{
    grid-template-columns:1fr;
}

.shop-grid{
    grid-template-columns:1fr;
}

}
