
/* 기본 폰트 및 레이아웃 설정 */
        html {
            box-sizing: border-box;
        }

        *, *:before, *:after {
            box-sizing: inherit;
        }

        body {
            font-family: 'Noto Sans KR', sans-serif;
            background-color: #f0f8ff; /* 하늘색 배경 */
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            color: #333;
            /* 모바일에서는 패딩 없이 전체 화면을 사용 */
            padding: 0;
        }

        .simulation-container {
            background-color: white;
            /* 모바일에서는 테두리 및 그림자 없이 전체 폭을 사용 */
            width: 100%;
            padding: 0;
            border-radius: 0;
            box-shadow: none;
            text-align: center;
            position: relative;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        header h1 {
            color: #2c5b2c;
            margin-top: 0;
        }

        /* 오름이 위치할 배경 */
        .oreum-background {
            background: linear-gradient(to top, #abddaa, #d9ead3);
            width: 100%;
            height: 200px; /* 모바일에서 더 작게 */
            margin: 20px 0;
            border-radius: 15px;
            display: flex;
            justify-content: center;
            align-items: flex-end;
            position: relative;
            overflow: hidden;
        }

        /* 오름 본체 스타일 */
        .oreum {
            width: 200px;
            height: 100px;
            background-color: #a38b79; /* Lv.1 흙색 */
            border-radius: 100px 100px 0 0;
            transition: all 0.7s ease-in-out;
            position: relative;
        }
        
        /* 나무 요소를 위한 컨테이너 */
        .tree-container {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
        }

        /* 나무 스타일 (초기에는 숨김) */
        .tree {
            position: absolute;
            bottom: 80%;
            opacity: 0;
            transition: opacity 1s ease-in-out;
        }
        .tree .trunk {
            width: 6px;
            height: 20px;
            background-color: #5c3a21;
            position: absolute;
            bottom: -20px;
        }
        .tree .leaves {
            width: 25px;
            height: 35px;
            background-color: #2e6b2e;
            border-radius: 50%;
        }

        #tree1 { left: 30%; }
        #tree2 { left: 60%; }

        /* 레벨별 오름 스타일 변화 */
        .oreum.level-2 {
            background-color: #8b9a79; /* 흙 + 연두색 */
            height: 120px;
        }
        .oreum.level-3 {
            background-color: #72a172; /* 초록색 */
            height: 140px;
        }
        .oreum.level-3 #tree1 { opacity: 1; } /* 3레벨에 첫번째 나무 등장 */
        
        .oreum.level-4 {
            background-color: #4a7e4a; /* 짙은 초록색 */
            height: 160px;
        }
        .oreum.level-4 #tree1, .oreum.level-4 #tree2 { opacity: 1; } /* 4레벨에 두번째 나무 등장 */
        
        .oreum.level-5 {
            background: linear-gradient(to top, #2c5b2c, #4a7e4a); /* 더 풍성한 초록색 */
            height: 180px;
        }
        .oreum.level-5 #tree1, .oreum.level-5 #tree2 { opacity: 1; }

        /* 정보 대시보드 */
        .dashboard {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 10px;
            background-color: #f4f4f4;
            padding: 15px;
            border-radius: 10px;
            margin-bottom: 20px;
        }
        .stat {
            font-size: 1rem;
        }
        .stat span {
            display: block;
            font-size: 1.5rem;
            font-weight: 700;
            color: #4a7e4a;
        }
        
        /* 센서 대시보드 */
        .sensor-dashboard {
            display: flex;
            flex-direction: column;
            gap: 5px;
            background-color: #f4f4f4;
            padding: 15px;
            border-radius: 10px;
            margin-bottom: 20px;
            text-align: left;
        }
        .sensor-dashboard p {
            font-size: 0.9rem;
            color: #555;
        }
        .sensor-dashboard .value {
            font-weight: bold;
            color: #2c5b2c;
        }
        
        /* 활동 로그 */
        .log-container {
            margin-top: 20px;
            background-color: #f4f4f4;
            border-radius: 10px;
            padding: 10px;
            height: 80px;
            overflow-y: auto;
            text-align: left;
            font-size: 0.9rem;
        }
        .log-container p {
            margin: 5px 0;
            color: #555;
        }

        /* 알림 모달 */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }
        .modal {
            background-color: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            max-width: 300px;
            text-align: center;
        }

        /* 미션 모달 */
        #mission-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(5px);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        #mission-modal {
            background: linear-gradient(135deg, #f0fdf4, #d1fae5);
            padding: 2rem;
            border-radius: 1.5rem;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
            width: 90%;
            max-width: 450px;
            text-align: center;
            color: #1f2937;
            position: relative;
            animation: slideIn 0.5s ease-out;
        }
        
        /* 보상 모달 추가 */
        #rewards-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(5px);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }
        
        #rewards-modal {
            background-color: #d1d5db; /* 회색 배경 */
            padding: 2rem;
            border-radius: 1rem;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
            width: 90%;
            max-width: 450px;
            text-align: center;
            color: #1f2937;
            position: relative;
            animation: slideIn 0.5s ease-out;
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }
        
        .rewards-header {
            background-color: #9ca3af; /* 짙은 회색 배경 */
            padding: 1rem;
            border-radius: 0.75rem;
            color: white;
            position: relative;
        }
        
        .rewards-header h2 {
            font-size: 1.5rem;
            font-weight: bold;
            text-align: left;
        }
        
        .rewards-header p {
            font-size: 1rem;
            font-weight: bold;
            margin-top: 0.5rem;
        }
        
        .progress-bar-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 1rem;
            position: relative;
        }
        
        .progress-bar {
            position: absolute;
            width: 100%;
            height: 8px;
            background-color: #e5e7eb;
            border-radius: 9999px;
            z-index: 1;
        }
        
        .progress-line {
            height: 100%;
            width: 0%;
            background-color: #6366f1; /* 보라색 */
            border-radius: 9999px;
        }

        .progress-circle {
            width: 20px;
            height: 20px;
            background-color: white;
            border-radius: 50%;
            border: 4px solid #6366f1; /* 보라색 테두리 */
            z-index: 2;
            transition: all 0.3s ease-in-out;
        }
        
        .reward-item {
            display: flex;
            align-items: center;
            background-color: #60a5fa; /* 파란색 배경 */
            color: white;
            padding: 1rem;
            border-radius: 9999px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            gap: 1rem;
            font-weight: bold;
            transition: transform 0.2s ease-in-out;
        }
        
        .reward-item.completed {
            background-color: #16a34a; /* 초록색 배경 */
            opacity: 0.8;
        }
        
        .reward-item:hover {
            transform: translateY(-2px);
        }
        
        .reward-icon-container {
            width: 30px;
            height: 30px;
            background-color: #e5e7eb;
            color: #6b7280;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            transition: background-color 0.3s, color 0.3s;
        }

        .reward-item.completed .reward-icon-container {
            background-color: #dcfce7; /* 연두색 배경 */
            color: #14532d;
        }

        @keyframes slideIn {
            from {
                transform: translateY(-50px);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }
        
        #mission-modal h2, #rewards-modal h2 {
            font-size: 2.2rem;
            font-weight: bold;
            color: #065f46;
            margin-bottom: 1rem;
            text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
        }

        .mission-list {
            margin-top: 1.5rem;
            padding: 0;
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 1rem;
            text-align: left;
        }
        
        .mission-item.gemini-generated-item {
            background-color: #dcfce7; /* 더 밝은 초록색 배경 */
            border-left: 5px solid #10b981; /* 강조 표시 */
            animation: fadeIn 0.5s ease-in-out;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .mission-item {
            background-color: white;
            padding: 1rem;
            border-radius: 1rem;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
            border: 1px solid #d1fae5;
            transition: transform 0.2s ease-in-out;
        }

        .mission-item:hover {
            transform: translateY(-5px);
        }

        .mission-item h3 {
            font-weight: bold;
            color: #047857;
            margin-bottom: 0.5rem;
            font-size: 1.1rem;
        }
        
        .mission-item p {
            color: #4b5563;
            font-size: 0.9rem;
        }
        
        .mission-close-btn, .rewards-close-btn {
            background-color: #065f46;
            color: white;
            padding: 0.75rem 2rem;
            border-radius: 9999px;
            font-weight: bold;
            margin-top: 2rem;
            border: none;
            cursor: pointer;
            transition: background-color 0.3s;
        }
        
        .mission-close-btn:hover, .rewards-close-btn:hover {
            background-color: #047857;
        }
        
        /* 사이드 패널 관련 스타일 */
        .side-panel-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.4);
            z-index: 999;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
        }

        .side-panel-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        .side-panel {
            position: fixed;
            top: 0;
            right: 0;
            width: 300px; /* 원하는 폭으로 조정 */
            height: 100%;
            background-color: #2d3748; /* 진한 회색 */
            z-index: 1000;
            transform: translateX(100%);
            transition: transform 0.3s ease-in-out;
            color: white;
            padding: 20px;
            box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
            display: flex;
            flex-direction: column;
        }

        .side-panel.active {
            transform: translateX(0);
        }

        .side-panel-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-bottom: 20px;
            border-bottom: 1px solid #4a5568;
            margin-bottom: 20px;
        }

        .side-panel-header h2 {
            font-weight: bold;
            font-size: 1.5rem;
            cursor: pointer;
            transition: color 0.2s;
        }
        .side-panel-header h2:hover {
            color: #a0aec0;
        }

        .side-panel-header button {
            background: none;
            border: none;
            color: white;
            font-size: 1.5rem;
            cursor: pointer;
        }
        .side-panel-content {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
        
        .side-panel-content .stat {
            background-color: #4a5568;
            padding: 10px;
            border-radius: 8px;
            margin-bottom: 10px;
            width: 100%;
            text-align: center;
        }
        .side-panel-content .stat p {
            font-size: 0.9rem;
            color: #ccc;
        }
        .side-panel-content .stat span {
            display: block;
            font-size: 1.2rem;
            font-weight: 700;
            color: #90f58d;
        }
        
        .google-btn {
            background-color: white;
            color: #4a5568;
            padding: 10px 20px;
            border-radius: 8px;
            font-weight: bold;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            cursor: pointer;
            width: 100%;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            transition: transform 0.2s;
        }
        
        .google-btn:hover {
            transform: translateY(-2px);
        }

        /* 미디어 쿼리를 사용해 반응형 디자인 적용 */
        @media (min-width: 640px) {
            body {
                padding: 20px;
            }
            .simulation-container {
                padding: 20px;
                border-radius: 20px;
                box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
                width: 90%;
                max-width: 500px;
            }
            .oreum-background {
                height: 250px;
            }
            .oreum {
                width: 200px;
                height: 100px;
            }
            .stat span {
                font-size: 1.5rem;
            }
        }
        /* 미션 상세 모달 오버레이 */
#mission-detail-modal-overlay {
    display: none; /* 초기에는 숨김 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* 반투명 검정 배경 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* 다른 요소 위에 표시 */
    animation: fadeIn 0.3s ease-in-out;
}

/* 모달 컨테이너 (내용을 감싸는 박스) */
#mission-detail-modal-overlay .modal-container {
    background-color: #fff;
    padding: 2.5rem; /* 여백을 넉넉하게 */
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: scale(0.95);
    animation: modalSlideUp 0.3s forwards;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 모달 제목 스타일 */
#mission-detail-modal-overlay .modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c5b2c; /* 오름이의 초록색 */
    text-align: center;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

/* 모달 메시지 스타일 */
#mission-detail-modal-overlay .modal-message {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.6;
    text-align: justify;
}

/* 모달 닫기 버튼 */
#mission-detail-modal-overlay .modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #718096;
    transition: color 0.2s ease;
}

#mission-detail-modal-overlay .modal-close-btn:hover {
    color: #2c5b2c;
}

/* 모달 애니메이션 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from {
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* 미션 목록 아이템에 커서 효과 추가 */
.mission-item {
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.mission-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}/* 미션 상세 모달 오버레이 */
#mission-detail-modal-overlay {
    display: none; /* 초기에는 숨김 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* 반투명 검정 배경 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* 다른 요소 위에 표시 */
    animation: fadeIn 0.3s ease-in-out;
}

/* 모달 컨테이너 (내용을 감싸는 박스) */
#mission-detail-modal-overlay .modal-container {
    background-color: #fff;
    padding: 2.5rem; /* 여백을 넉넉하게 */
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: scale(0.95);
    animation: modalSlideUp 0.3s forwards;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 모달 제목 스타일 */
#mission-detail-modal-overlay .modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c5b2c; /* 오름이의 초록색 */
    text-align: center;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

/* 모달 메시지 스타일 */
#mission-detail-modal-overlay .modal-message {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.6;
    text-align: justify;
}

/* 모달 닫기 버튼 */
#mission-detail-modal-overlay .modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #718096;
    transition: color 0.2s ease;
}

#mission-detail-modal-overlay .modal-close-btn:hover {
    color: #2c5b2c;
}

/* 모달 애니메이션 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from {
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* 미션 목록 아이템에 커서 효과 추가 */
.mission-item {
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.mission-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
