:root {
    --primary-color: #ff9a9e;
    --secondary-color: #fad0c4;
    --bg-room: #fff5e6;
    --bg-walk: #a1c4fd;
    --bar-hunger: #ff6b6b;
    --bar-happiness: #feca57;
    --bar-energy: #1dd1a1;
}

body {
    margin: 0;
    font-family: 'Nanum Gothic', sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

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

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

.modal.hidden { display: none; }

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    width: 80%;
}

.modal-content input {
    width: 90%;
    padding: 10px;
    margin: 15px 0;
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    font-size: 1rem;
}

.modal-content button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

/* Header */
header {
    padding: 20px;
    background: white;
}

.status-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.level-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
}

.exp-bar-container {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.exp-fill {
    height: 100%;
    background: #ff9a9e;
    width: 0%;
    transition: width 0.3s;
}

/* Main Scene */
#game-scene {
    flex: 1;
    position: relative;
    transition: background 0.5s;
}

.room-bg { background-color: var(--bg-room); }
.walk-bg { background-color: var(--bg-walk); }

#status-bars {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
}

.bar-bg {
    width: 100px;
    height: 10px;
    background: rgba(255,255,255,0.5);
    border-radius: 5px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 100%;
    transition: width 0.3s;
}

.hunger { background: var(--bar-hunger); }
.happiness { background: var(--bar-happiness); }
.energy { background: var(--bar-energy); }

/* Dog CSS Character */
#dog-container {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
}

.dog {
    width: 120px;
    height: 100px;
    background: #fdfdfd;
    border-radius: 50% 50% 40% 40%;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.dog::after { /* Dog Body */
    content: '';
    position: absolute;
    bottom: -40px;
    left: 10px;
    width: 100px;
    height: 80px;
    background: #fdfdfd;
    border-radius: 40%;
    z-index: -1;
}

.ears {
    position: absolute;
    top: -10px;
    width: 100%;
    display: flex;
    justify-content: space-between;
}

.ears::before, .ears::after {
    content: '';
    width: 30px;
    height: 50px;
    background: #e67e22;
    border-radius: 50%;
}

.face {
    position: absolute;
    top: 40px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.eyes {
    display: flex;
    gap: 40px;
}

.eyes::before, .eyes::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #333;
    border-radius: 50%;
}

.nose {
    width: 12px;
    height: 8px;
    background: #000;
    border-radius: 50%;
    margin-top: 10px;
}

.tail {
    position: absolute;
    right: -20px;
    bottom: 0;
    width: 30px;
    height: 15px;
    background: #fdfdfd;
    border-radius: 10px;
    transform-origin: left center;
    animation: wag 0.5s infinite alternate;
}

@keyframes wag {
    from { transform: rotate(0deg); }
    to { transform: rotate(30deg); }
}

/* Animations */
.idle { animation: bounce 2s infinite ease-in-out; }
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.walk-anim { animation: walking 0.5s infinite alternate; }
@keyframes walking {
    from { transform: translateX(-60px); }
    to { transform: translateX(60px); }
}

/* Footer Buttons */
footer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    border: none;
    background: #f8f9fa;
    padding: 12px 5px;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.action-btn:hover { background: #e9ecef; }
.action-btn:active { transform: scale(0.95); }
.action-btn i { font-size: 1.2rem; color: #555; }
.action-btn span { font-size: 0.75rem; font-weight: bold; color: #777; }

.hidden { display: none; }
