/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f6fa;
    color: #2d3436;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
    margin: 0;
    overflow-x: hidden;
}

.game-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    max-height: 95vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Game header */
.game-header {
    background: linear-gradient(135deg, #FF9A8B, #FF6B6B);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.coin-display {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.coin-icon {
    font-size: 1.2rem;
}

/* Game area */
.game-area {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

/* Status bars */
.status-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.bar-container {
    flex: 1;
    height: 15px;
    background-color: #f1f1f1;
    border-radius: 10px;
    overflow: hidden;
}

.bar {
    height: 100%;
    width: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

#hunger-bar {
    background-color: #FF6B6B;
}

#cleanliness-bar {
    background-color: #48DBFB;
}

#happiness-bar {
    background-color: #FFDA79;
}

#energy-bar {
    background-color: #1DD1A1;
}

/* Pet container */
.pet-container {
    position: relative;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
}

.pou {
    position: relative;
    width: 150px;
    height: 150px;
    transition: transform 0.3s ease;
}

.pou-body {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #8B5A2B;
    /* Create a more triangular shape with very rounded corners */
    border-radius: 50% 50% 40% 40% / 60% 60% 40% 40%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    /* Make it slightly wider at the bottom */
    transform: scaleX(1.05);
}

/* Add a subtle gradient to give more dimension */
.pou-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), transparent 60%);
    border-radius: inherit;
}

/* Make the bottom wider for a more triangular effect */
.pou-body::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: -10px;
    right: -10px;
    height: 50px;
    background-color: #8B5A2B;
    border-radius: 50%;
    z-index: -1;
}

/* Position eyes higher for the triangular shape and closer together */
.pou-eyes {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 50%; /* Reduced from 70% to bring eyes closer */
    height: 20px;
    display: flex;
    justify-content: space-between;
}

/* Make the eyes slightly larger */
.pou-eye {
    width: 22px; /* Increased from 20px */
    height: 22px; /* Increased from 20px */
    background-color: white;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Make pupils slightly larger too */
.pupil {
    position: absolute;
    width: 10px; /* Increased from 8px */
    height: 10px; /* Increased from 8px */
    background-color: #333;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

/* Eye movement for more liveliness */
.pou.happy .pupil {
    animation: look-around 8s infinite;
}

.pou.sad .pupil {
    top: 60%; /* Look down when sad */
}

/* Completely revise the sleeping eye animation */
.pou.sleeping .pou-eye {
    background-color: transparent;
    box-shadow: none;
    overflow: visible;
}

.pou.sleeping .pou-eye::before {
    content: '';
    position: absolute;
    width: 15px;
    height: 2px;
    background-color: #333;
    border-radius: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pou.sleeping .pupil {
    opacity: 0;
}

/* Sleeping mouth - slightly open */
.pou.sleeping .pou-mouth {
    width: 15px;
    height: 5px;
    background-color: transparent;
    border: 2px solid #333;
    border-radius: 50%;
    border-top: none;
}

/* Add Z's animation for sleeping */
.pou.sleeping::after {
    content: "💤";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    animation: float-z 3s infinite ease-in-out;
}

@keyframes float-z {
    0% { transform: translate(0, 0) scale(0.8); opacity: 0; }
    50% { transform: translate(10px, -15px) scale(1); opacity: 1; }
    100% { transform: translate(20px, -30px) scale(0.8); opacity: 0; }
}

@keyframes look-around {
    0%, 100% { transform: translate(-50%, -50%); }
    25% { transform: translate(-30%, -50%); }
    50% { transform: translate(-50%, -30%); }
    75% { transform: translate(-70%, -50%); }
}

/* Update mouth to be a simple black line */
.pou-mouth {
    position: absolute;
    bottom: 35%;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Happy mouth - curved upward */
.pou.happy .pou-mouth {
    width: 30px;
    height: 15px;
    background-color: transparent;
    border: 2px solid #333;
    border-top: none;
    border-radius: 0 0 15px 15px;
}

/* Sad mouth - curved downward */
.pou.sad .pou-mouth {
    width: 30px;
    height: 15px;
    background-color: transparent;
    border: 2px solid #333;
    border-bottom: none;
    border-radius: 15px 15px 0 0;
    bottom: 30%;
}

/* Eating mouth - circular */
.pou.eating .pou-mouth {
    width: 20px;
    height: 20px;
    background-color: transparent;
    border: 2px solid #333;
    border-radius: 50%;
    animation: chew 0.5s infinite alternate;
}

/* Adjust animations for the triangular shape */
@keyframes bounce {
    0%, 100% { transform: translateY(0) scaleY(1) scaleX(1.05); }
    50% { transform: translateY(-10px) scaleY(0.95) scaleX(1.1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0); }
    25% { transform: translateX(-5px) rotate(-5deg); }
    75% { transform: translateX(5px) rotate(5deg); }
}

/* Adjust clothing positions for the triangular shape */
.pou-hat {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 30px;
    z-index: 10;
}

/* Simplify shirt positioning to cover bottom third */
.pou-shirt {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 33%; /* Cover bottom third */
    z-index: 5;
    border-radius: 50% 50% 40% 40% / 0% 0% 40% 40%; /* Match Pou's bottom shape */
}

.pou-accessory {
    position: absolute;
    top: 45%;
    left: 20%;
    width: 25px;
    height: 25px;
    z-index: 15;
}

.interaction-area {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* Action buttons */
.action-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 60px;
    background-color: #FF9A8B;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background-color: #FF6B6B;
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1.5rem;
}

.btn-text {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Feed modal */
.food-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.food-item {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    width: calc(50% - 10px);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.food-item:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

.food-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.food-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.food-price {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Play modal */
.game-selection {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    justify-content: center;
}

.game-option {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    width: 120px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-option:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

.game-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.game-name {
    font-weight: 600;
}

/* Dress modal */
.clothing-categories {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.category-btn {
    flex: 1;
    background-color: #f8f9fa;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

.category-btn.active {
    background-color: #FF9A8B;
    color: white;
}

.clothing-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.clothing-item {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    width: calc(33.33% - 10px);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clothing-item:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

.clothing-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.clothing-name {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.clothing-price {
    color: #6c757d;
    font-size: 0.8rem;
}

.clothing-item.owned {
    border: 2px solid #1DD1A1;
}

.clothing-item.equipped {
    background-color: #FFDA79;
}

/* Game area modal */
.game-modal-content {
    max-width: 500px;
    padding: 20px;
}

#game-container {
    background-color: #f8f9fa;
    border-radius: 10px;
    height: 300px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.game-controls {
    display: flex;
    justify-content: center;
}

#start-game-btn {
    background-color: #1DD1A1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

#start-game-btn:hover {
    background-color: #10ac84;
}

/* Game footer */
.game-footer {
    padding: 15px;
    display: flex;
    justify-content: center;
    border-top: 1px solid #eee;
}

.back-button {
    background-color: #2d3436;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-button:hover {
    background-color: #1e2527;
    transform: translateY(-2px);
}

/* Animations */
@keyframes bounce {
    0%, 100% { transform: translateY(0) scaleY(1) scaleX(1.05); }
    50% { transform: translateY(-10px) scaleY(0.95) scaleX(1.1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0); }
    25% { transform: translateX(-5px) rotate(-5deg); }
    75% { transform: translateX(5px) rotate(5deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pou.happy {
    animation: bounce 2s infinite;
}

.pou.sad {
    animation: shake 2s infinite;
}

.pou.eating {
    animation: none;
}

.pou.sleeping {
    animation: none;
    transform: rotate(5deg);
}

/* Responsive design */
@media (max-width: 500px) {
    .action-buttons {
        flex-wrap: wrap;
    }
    
    .action-btn {
        flex: 1 0 calc(20% - 10px);
    }
    
    .food-item, .clothing-item {
        width: calc(50% - 10px);
    }
}

@media (max-width: 350px) {
    .action-btn {
        flex: 1 0 calc(33.33% - 10px);
        margin-bottom: 10px;
    }
    
    .btn-text {
        font-size: 0.7rem;
    }
    
    .food-item, .clothing-item {
        width: 100%;
    }
}

/* Hat styles */
.hat-1 {
    background-color: red;
    border-radius: 50% 50% 0 0;
}

.hat-2 {
    background-color: blue;
    border-radius: 0;
    height: 20px;
    width: 60px;
    top: -20px;
}

.hat-3 {
    background-color: yellow;
    border-radius: 50%;
    height: 30px;
    width: 30px;
    top: -20px;
}

/* Update shirt styles to be simpler */
.shirt-1 {
    background-color: #27ae60; /* Green */
    border-top: 2px solid #2ecc71;
}

.shirt-2 {
    background-color: #9b59b6; /* Purple */
    border-top: 2px solid #8e44ad;
}

.shirt-3 {
    background-color: #e67e22; /* Orange */
    border-top: 2px solid #d35400;
}

/* Accessory styles */
.accessory-1 {
    background-color: pink;
    border-radius: 50%;
}

.accessory-2 {
    background-color: cyan;
    border-radius: 0;
    transform: rotate(45deg);
}

.accessory-3 {
    background-color: lime;
    border-radius: 50% 0 50% 0;
}
